Print this page
rev 5696 : 6336885: RFE: Locale Data Deployment Enhancements
4609153: Provide locale data for Indic locales
5104387: Support for gl_ES locale (galician language)
6337471: desktop/system locale preferences support
7056139: (cal) SPI support for locale-dependent Calendar parameters
7058206: Provide CalendarData SPI for week params and display field value names
7073852: Support multiple scripts for digits and decimal symbols per locale
7079560: [Fmt-Da] Context dependent month names support in SimpleDateFormat
7171324: getAvailableLocales() of locale sensitive services should return the actual availability of locales
7151414: (cal) Support calendar type identification
7168528: LocaleServiceProvider needs to be aware of Locale extensions
7171372: (cal) locale's default Calendar should be created if unknown calendar is specified
Summary: JEP 127: Improve Locale Data Packaging and Adopt Unicode CLDR Data (part 1 w/o packaging changes. by Naoto Sato and Masayoshi Okutsu)
Split |
Close |
Expand all |
Collapse all |
--- old/makefiles/GensrcLocaleDataMetaInfo.gmk
+++ new/makefiles/GensrcLocaleDataMetaInfo.gmk
1 1 #
2 2 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
3 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 #
5 5 # This code is free software; you can redistribute it and/or modify it
6 6 # under the terms of the GNU General Public License version 2 only, as
7 7 # published by the Free Software Foundation. Oracle designates this
8 8 # particular file as subject to the "Classpath" exception as provided
9 9 # by Oracle in the LICENSE file that accompanied this code.
10 10 #
11 11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 14 # version 2 for more details (a copy is included in the LICENSE file that
15 15 # accompanied this code).
16 16 #
17 17 # You should have received a copy of the GNU General Public License version
18 18 # 2 along with this work; if not, write to the Free Software Foundation,
19 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 20 #
21 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 22 # or visit www.oracle.com if you need additional information or have any
23 23 # questions.
24 24 #
25 25
26 26 # Scan for all locale resources and extract for which locales there exists
27 27 # resources. Then put this meta information about exiting (supported?) locales
28 28 # into LocaleDataMetaInfo.java
29 29
30 30 # First go look for all locale files
31 31 LOCALE_FILES:=$(shell $(FIND) $(JDK_TOPDIR)/src/share/classes \
32 32 -name "FormatData_*.java" -o -name "FormatData_*.properties" -o \
33 33 -name "CollationData_*.java" -o -name "CollationData_*.properties" -o \
34 34 -name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \
35 35 -name "LocaleNames_*.java" -o -name "LocaleNames_*.properties" -o \
36 36 -name "CurrencyNames_*.java" -o -name "CurrencyNames_*.properties" -o \
37 37 -name "CalendarData_*.java" -o -name "CalendarData_*.properties")
38 38
39 39 # Then translate the locale files into for example: FormatData_sv
↓ open down ↓ |
39 lines elided |
↑ open up ↑ |
40 40 LOCALE_RESOURCES:=$(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES)))))
41 41
42 42 # Include the list of resources found during the previous compile.
43 43 -include $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/_the.locale_resources
44 44
45 45 MISSING_RESOURCES:=$(filter-out $(LOCALE_RESOURCES),$(PREV_LOCALE_RESOURCES))
46 46 NEW_RESOURCES:=$(filter-out $(PREV_LOCALE_RESOURCES),$(LOCALE_RESOURCES))
47 47
48 48 ifneq (,$(MISSING_RESOURCES)$(NEW_RESOURCES))
49 49 # There is a difference in the number of supported resources. Trigger a regeneration.
50 - $(shell $(RM) $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/LocaleDataMetaInfo.java)
50 + $(shell $(RM) $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/locale/provider/LocaleDataMetaInfo.java)
51 51 endif
52 52
53 53 # The non-euro zone locales have to be separated from the euro-zone locales.
54 54 NON_EURO_LOCALES:=ar% hi% iw% ja% ko% th% vi% zh%
55 55
56 +# ja-JP-JP and th-TH-TH need to be manually added, as they don't have any resource files.
57 +ALL_NON_EURO_LOCALES:=ja-JP-JP th-TH-TH
58 +
59 +SED_ARGS:=-e 's|$(HASH)warn This file is preprocessed before being compiled|// -- This file was mechanically generated: Do not edit! -- //|g'
60 +
56 61 # This macro creates a sed expression that substitues for example:
57 62 # #FormatData_EuroLocales# with: be be_BY bg bg_BG ca ca_ES... and some more.
58 -CAPTURE_LOCALE='s/$$(HASH)$1_$2EuroLocales$$(HASH)/ $$($3 $(NON_EURO_LOCALES),$$(filter-out $1,$$(subst $1_,,$$(filter $1_%,$(LOCALE_RESOURCES)))))/g'
63 +define CaptureLocale
64 + $1_LOCALES := $$(subst _,-,$$(filter-out $1,$$(subst $1_,,$$(filter $1_%,$(LOCALE_RESOURCES)))))
65 + $1_EURO_LOCALES := $$(filter-out $(NON_EURO_LOCALES),$$($1_LOCALES))
66 + $1_NON_EURO_LOCALES := $$(filter $(NON_EURO_LOCALES),$$($1_LOCALES))
59 67
60 -SED_ARGS:=-e 's|$(HASH)warn This file is preprocessed before being compiled|// -- This file was mechanically generated: Do not edit! -- //|g'
68 + ALL_EURO_LOCALES += $$($1_EURO_LOCALES)
69 + ALL_NON_EURO_LOCALES += $$($1_NON_EURO_LOCALES)
70 +
71 + SED_ARGS+= -e 's/$$(HASH)$1_EuroLocales$$(HASH)/ $$($1_EURO_LOCALES)/g'
72 + SED_ARGS+= -e 's/$$(HASH)$1_NonEuroLocales$$(HASH)/ $$($1_NON_EURO_LOCALES)/g'
73 +endef
74 +
61 75 #sun.text.resources.FormatData
62 -$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,FormatData,,filter-out))
63 -$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,FormatData,Non,filter))
76 +$(eval $(call CaptureLocale,FormatData))
64 77
65 78 #sun.text.resources.CollationData
66 -$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,CollationData,,filter-out))
67 -$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,CollationData,Non,filter))
79 +$(eval $(call CaptureLocale,CollationData))
68 80
69 81 #sun.util.resources.TimeZoneNames
70 -$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,TimeZoneNames,,filter-out))
71 -$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,TimeZoneNames,Non,filter))
82 +$(eval $(call CaptureLocale,TimeZoneNames))
72 83
73 84 #sun.util.resources.LocaleNames
74 -$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,LocaleNames,,filter-out))
75 -$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,LocaleNames,Non,filter))
85 +$(eval $(call CaptureLocale,LocaleNames))
76 86
77 87 #sun.util.resources.CurrencyNames
78 -$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,CurrencyNames,,filter-out))
79 -$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,CurrencyNames,Non,filter))
88 +$(eval $(call CaptureLocale,CurrencyNames))
80 89
81 90 #sun.util.resources.CalendarData
82 -$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,CalendarData,,filter-out))
83 -$(eval SED_ARGS+=-e $(call CAPTURE_LOCALE,CalendarData,Non,filter))
91 +$(eval $(call CaptureLocale,CalendarData))
84 92
85 -$(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/LocaleDataMetaInfo.java: \
86 - $(JDK_TOPDIR)/src/share/classes/sun/util/LocaleDataMetaInfo-XLocales.java.template
93 +SED_ARGS+= -e 's/$(HASH)AvailableLocales_EuroLocales$(HASH)/$(sort $(ALL_EURO_LOCALES))/g'
94 +SED_ARGS+= -e 's/$(HASH)AvailableLocales_NonEuroLocales$(HASH)/$(sort $(ALL_NON_EURO_LOCALES))/g'
95 +
96 +$(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/locale/provider/LocaleDataMetaInfo.java: \
97 + $(JDK_TOPDIR)/src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template
87 98 $(MKDIR) -p $(@D)
88 99 $(ECHO) Creating sun/util/LocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources.
89 100 $(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" > $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/_the.locale_resources
90 - $(SED) $(SED_ARGS) $(JDK_TOPDIR)/src/share/classes/sun/util/LocaleDataMetaInfo-XLocales.java.template \
91 - > $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/LocaleDataMetaInfo.java
101 + $(SED) $(SED_ARGS) $< > $@
92 102
93 -GENSRC_LOCALEDATAMETAINFO:=$(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/LocaleDataMetaInfo.java
103 +GENSRC_LOCALEDATAMETAINFO:=$(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/locale/provider/LocaleDataMetaInfo.java
94 104
95 105 ###
96 106
97 107 GENSRC_CRBC_DST := $(JDK_OUTPUTDIR)/gensrc_localedatametainfo/sun/util/CoreResourceBundleControl.java
98 108 GENSRC_CRBC_CMD := $(JDK_TOPDIR)/makefiles/scripts/localelist.sh
99 109
100 110 JRE_NONEXIST_LOCALES := en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
101 111
102 112 $(GENSRC_CRBC_DST) : $(JDK_TOPDIR)/src/share/classes/sun/util/CoreResourceBundleControl-XLocales.java.template \
103 113 $(GENSRC_CRBC_CMD)
104 114 $(MKDIR) -p $(@D)
105 115 NAWK="$(NAWK)" SED="$(SED)" $(SH) $(GENSRC_CRBC_CMD) "$(JRE_NONEXIST_LOCALES)" $< $@
106 116
107 117 GENSRC_LOCALEDATAMETAINFO += $(GENSRC_CRBC_DST)
108 118
109 119 ###
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX