android amlogic 客户配置文件大部分位于device/amlogic目录下,
设定语言在device/amlogic/c03ref/c03ref.mk中的PRODUCT_LOCALES
支持的多语言在build/target/product/languages_small.mk和build/target/product/languages_full.mk中
语言的判断在external/icu4c/stubdata/Android.mk中下面这段:config := $(word 1, \ $(if $(findstring ar,$(PRODUCT_LOCALES)),large) \ $(if $(findstring da,$(PRODUCT_LOCALES)),large) \ $(if $(findstring el,$(PRODUCT_LOCALES)),large) \ $(if $(findstring fi,$(PRODUCT_LOCALES)),large) \ $(if $(findstring he,$(PRODUCT_LOCALES)),large) \ $(if $(findstring hr,$(PRODUCT_LOCALES)),large) \ $(if $(findstring hu,$(PRODUCT_LOCALES)),large) \ $(if $(findstring id,$(PRODUCT_LOCALES)),large) \ $(if $(findstring ko,$(PRODUCT_LOCALES)),large) \ $(if $(findstring nb,$(PRODUCT_LOCALES)),large) \ $(if $(findstring pt,$(PRODUCT_LOCALES)),large) \ $(if $(findstring ro,$(PRODUCT_LOCALES)),large) \ $(if $(findstring ru,$(PRODUCT_LOCALES)),large) \ $(if $(findstring sk,$(PRODUCT_LOCALES)),large) \ $(if $(findstring sr,$(PRODUCT_LOCALES)),large) \ $(if $(findstring sv,$(PRODUCT_LOCALES)),large) \ $(if $(findstring th,$(PRODUCT_LOCALES)),large) \ $(if $(findstring tr,$(PRODUCT_LOCALES)),large) \ $(if $(findstring uk,$(PRODUCT_LOCALES)),large) \ $(if $(findstring zh,$(PRODUCT_LOCALES)),large) \ $(if $(findstring ja,$(PRODUCT_LOCALES)),us-japan) \ $(if $(findstring it,$(PRODUCT_LOCALES)),us-euro) \ $(if $(findstring pl,$(PRODUCT_LOCALES)),us-euro) \ $(if $(findstring cs,$(PRODUCT_LOCALES)),default) \ $(if $(findstring de,$(PRODUCT_LOCALES)),default) \ $(if $(findstring fr,$(PRODUCT_LOCALES)),default) \ $(if $(findstring nl,$(PRODUCT_LOCALES)),default) \ us)
include $(LOCAL_PATH)/root.mk
PRODUCT_COPY_FILES += $(LOCAL_PATH)/$(root)-$(config).dat:/system/usr/icu/$(root).dat
选择默认语言,依靠build/core/Makefile中下面这段来实现:# Selects the first locale in the list given as the argument,# and splits it into language and region, which each may be# empty.define default-locale$(subst _, , $(firstword $(1)))endef
# Selects the first locale in the list given as the argument# and returns the language (or the region)define default-locale-language$(word 2, 2, $(call default-locale, $(1)))endefdefine default-locale-region$(word 3, 3, $(call default-locale, $(1)))endef
设定语言在device/amlogic/c03ref/c03ref.mk中的PRODUCT_LOCALES
支持的多语言在build/target/product/languages_small.mk和build/target/product/languages_full.mk中
语言的判断在external/icu4c/stubdata/Android.mk中下面这段:config := $(word 1, \ $(if $(findstring ar,$(PRODUCT_LOCALES)),large) \ $(if $(findstring da,$(PRODUCT_LOCALES)),large) \ $(if $(findstring el,$(PRODUCT_LOCALES)),large) \ $(if $(findstring fi,$(PRODUCT_LOCALES)),large) \ $(if $(findstring he,$(PRODUCT_LOCALES)),large) \ $(if $(findstring hr,$(PRODUCT_LOCALES)),large) \ $(if $(findstring hu,$(PRODUCT_LOCALES)),large) \ $(if $(findstring id,$(PRODUCT_LOCALES)),large) \ $(if $(findstring ko,$(PRODUCT_LOCALES)),large) \ $(if $(findstring nb,$(PRODUCT_LOCALES)),large) \ $(if $(findstring pt,$(PRODUCT_LOCALES)),large) \ $(if $(findstring ro,$(PRODUCT_LOCALES)),large) \ $(if $(findstring ru,$(PRODUCT_LOCALES)),large) \ $(if $(findstring sk,$(PRODUCT_LOCALES)),large) \ $(if $(findstring sr,$(PRODUCT_LOCALES)),large) \ $(if $(findstring sv,$(PRODUCT_LOCALES)),large) \ $(if $(findstring th,$(PRODUCT_LOCALES)),large) \ $(if $(findstring tr,$(PRODUCT_LOCALES)),large) \ $(if $(findstring uk,$(PRODUCT_LOCALES)),large) \ $(if $(findstring zh,$(PRODUCT_LOCALES)),large) \ $(if $(findstring ja,$(PRODUCT_LOCALES)),us-japan) \ $(if $(findstring it,$(PRODUCT_LOCALES)),us-euro) \ $(if $(findstring pl,$(PRODUCT_LOCALES)),us-euro) \ $(if $(findstring cs,$(PRODUCT_LOCALES)),default) \ $(if $(findstring de,$(PRODUCT_LOCALES)),default) \ $(if $(findstring fr,$(PRODUCT_LOCALES)),default) \ $(if $(findstring nl,$(PRODUCT_LOCALES)),default) \ us)
include $(LOCAL_PATH)/root.mk
PRODUCT_COPY_FILES += $(LOCAL_PATH)/$(root)-$(config).dat:/system/usr/icu/$(root).dat
选择默认语言,依靠build/core/Makefile中下面这段来实现:# Selects the first locale in the list given as the argument,# and splits it into language and region, which each may be# empty.define default-locale$(subst _, , $(firstword $(1)))endef
# Selects the first locale in the list given as the argument# and returns the language (or the region)define default-locale-language$(word 2, 2, $(call default-locale, $(1)))endefdefine default-locale-region$(word 3, 3, $(call default-locale, $(1)))endef