QQ飞车怎么突然出现电脑打字突然就跳光标的

r - How to install stringi library from archive and install the local icu52l.zip - Stack Overflow
Join the Stack Overflow Community
Stack Overflow is a community of 7.1 million programmers, just like you, helping each other.
J it only takes a minute:
We're bumbling through making some R code work in a production environment and as part of that we're installing some R packages as follows:
# Default directories and mirrors
WORKING_DIR
&- "/srv/foo/bar/baz"
&- paste( WORKING_DIR, "libs", sep="/" )
setwd(WORKING_DIR)
stringi.loc &- paste( WORKING_DIR, "stringi_0.4-1.tar.gz", sep="/" )
This might not be the most elegant way of installing R packages but it seems to work okay for us (any other tips on R package management would be welcome but a bit late at this stage :).
However, the stringi package seems to depend on the icu52l package, which it installs the
over the network:
checking for R... /usr/lib64/R/bin/R
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for cat... /bin/cat
checking for pkg-config... /usr/bin/pkg-config
checking with pkg-config for ICU4C installed... no
*** The pkg-config script did not detect ICU4C-devel libraries installed
*** We will build ICU4C from sources
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking elf.h usability... yes
checking elf.h presence... yes
checking for elf.h... yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/icu52_found.txt
g++ -I/usr/share/R/include -DNDEBUG -I. -Iicu52 -Iicu52/unicode -Iicu52/common -Iicu52/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DNDEBUG
-DU_HAVE_ELF_H -fpic
-c stri_brkiter.cpp -o stri_brkiter.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -Iicu52 -Iicu52/unicode -Iicu52/common -Iicu52/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DNDEBUG
-DU_HAVE_ELF_H -fpic
-c icu52/i18n/utmscale.c -o icu52/i18n/utmscale.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -Iicu52 -Iicu52/unicode -Iicu52/common -Iicu52/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DNDEBUG
-DU_HAVE_ELF_H -fpic
-c icu52/stubdata/stubdata.c -o icu52/stubdata/stubdata.o
g++ -shared -o stringi.so stri_brkiter.o stri_collator.o stri_common.o stri_compare.o stri_container_base.o stri_container_bytesearch.o stri_container_listint.o stri_container_listraw.o stri_container_listutf8.o stri_container_regex.o stri_container_usearch.o stri_container_utf16.o stri_container_utf8.o stri_container_utf8_indexable.o stri_encoding_conversion.o stri_encoding_detection.o stri_encoding_management.o stri_escape.o stri_exception.o stri_ICU_settings.o stri_join.o stri_length.o stri_pad.o stri_prepare_arg.o stri_random.o stri_reverse.o stri_search_class_count.o stri_search_class_detect.o stri_search_class_extract.o stri_search_class_locate.o stri_search_class_replace.o stri_search_class_split.o stri_search_class_startsendswith.o stri_search_class_subset.o stri_search_class_trim.o stri_search_common.o stri_search_coll_count.o stri_search_coll_detect.o stri_search_coll_extract.o stri_search_coll_locate.o stri_search_coll_replace.o stri_search_coll_split.o stri_search_coll_startsendswith.o stri_search_coll_subset.o stri_search_boundaries_count.o stri_search_boundaries_locate.o stri_search_boundaries_split.o stri_search_fixed_count.o stri_search_fixed_detect.o stri_search_fixed_extract.o stri_search_fixed_locate.o stri_search_fixed_replace.o stri_search_fixed_split.o stri_search_fixed_subset.o stri_search_fixed_startsendswith.o stri_search_in.o stri_search_other_replace.o stri_search_other_split.o stri_search_regex_count.o stri_search_regex_detect.o stri_search_regex_extract.o stri_search_regex_locate.o stri_search_regex_match.o stri_search_regex_replace.o stri_search_regex_split.o stri_search_regex_subset.o stri_stats.o stri_stringi.o stri_sub.o stri_test.o stri_trans_casemap.o stri_trans_normalization.o stri_trans_transliterate.o stri_ucnv.o stri_uloc.o stri_utils.o stri_wrap.o icu52/common/appendable.o icu52/common/bmpset.o icu52/common/brkeng.o icu52/common/brkiter.o icu52/common/bytestream.o icu52/common/bytestrie.o icu52/common/bytestriebuilder.o icu52/common/bytestrieiterator.o icu52/common/caniter.o icu52/common/chariter.o icu52/common/charstr.o icu52/common/dictbe.o icu52/common/dictionarydata.o icu52/common/dtintrv.o icu52/common/errorcode.o icu52/common/filterednormalizer2.o icu52/common/listformatter.o icu52/common/locavailable.o icu52/common/locbased.o icu52/common/locdispnames.o icu52/common/locid.o icu52/common/loclikely.o icu52/common/locresdata.o icu52/common/locutil.o icu52/common/messagepattern.o icu52/common/normalizer2.o icu52/common/normalizer2impl.o icu52/common/normlzr.o icu52/common/parsepos.o icu52/common/patternprops.o icu52/common/propname.o icu52/common/punycode.o icu52/common/putil.o icu52/common/rbbi.o icu52/common/rbbidata.o icu52/common/rbbinode.o icu52/common/rbbirb.o icu52/common/rbbiscan.o icu52/common/rbbisetb.o icu52/common/rbbistbl.o icu52/common/rbbitblb.o icu52/common/resbund_cnv.o icu52/common/resbund.o icu52/common/ruleiter.o icu52/common/schriter.o icu52/common/serv.o icu52/common/servlk.o icu52/common/servlkf.o icu52/common/servls.o icu52/common/servnotf.o icu52/common/servrbf.o icu52/common/servslkf.o icu52/common/stringpiece.o icu52/common/stringtriebuilder.o icu52/common/ubrk.o icu52/common/ucase.o icu52/common/ucasemap_titlecase_brkiter.o icu52/common/ucasemap.o icu52/common/ucharstrie.o icu52/common/ucharstriebuilder.o icu52/common/ucharstrieiterator.o icu52/common/uchriter.o icu52/common/ucnv_bld.o icu52/common/ucnv_ext.o icu52/common/ucnv_io.o icu52/common/ucnv2022.o icu52/common/ucnvbocu.o icu52/common/ucnvsel.o icu52/common/ucol_swp.o icu52/common/udata.o icu52/common/uhash_us.o icu52/common/uidna.o icu52/common/uinit.o icu52/common/uiter.o icu52/common/uloc.o icu52/common/umutex.o icu52/common/unames.o icu52/common/unifilt.o icu52/common/unifunct.o icu52/common/uniset_closure.o icu52/common/uniset_props.o icu52/common/uniset.o icu52/common/unisetspan.o icu52/common/unistr_case_locale.o icu52/common/unistr_case.o icu52/common/unistr_cnv.o icu52/common/unistr_props.o icu52/common/unistr_titlecase_brkiter.o icu52/common/unistr.o icu52/common/unorm.o icu52/common/unormcmp.o icu52/common/uobject.o icu52/common/uprops.o icu52/common/uresbund.o icu52/common/uscript_props.o icu52/common/uset_props.o icu52/common/uset.o icu52/common/usetiter.o icu52/common/ushape.o icu52/common/usprep.o icu52/common/ustack.o icu52/common/ustr_titlecase_brkiter.o icu52/common/ustr_wcs.o icu52/common/ustrcase_locale.o icu52/common/ustrcase.o icu52/common/ustrenum.o icu52/common/ustring.o icu52/common/ustrtrns.o icu52/common/utext.o icu52/common/util_props.o icu52/common/util.o icu52/common/utrie.o icu52/common/utrie2_builder.o icu52/common/utrie2.o icu52/common/uts46.o icu52/common/uvector.o icu52/common/uvectr32.o icu52/common/uvectr64.o icu52/common/cmemory.o icu52/common/cstring.o icu52/common/cwchar.o icu52/common/icudataver.o icu52/common/icuplug.o icu52/common/locmap.o icu52/common/propsvec.o icu52/common/uarrsort.o icu52/common/ubidi_props.o icu52/common/ubidi.o icu52/common/ubidiln.o icu52/common/ubidiwrt.o icu52/common/ucat.o icu52/common/uchar.o icu52/common/ucln_cmn.o icu52/common/ucmndata.o icu52/common/ucnv_cb.o icu52/common/ucnv_cnv.o icu52/common/ucnv_ct.o icu52/common/ucnv_err.o icu52/common/ucnv_lmb.o icu52/common/ucnv_set.o icu52/common/ucnv_u16.o icu52/common/ucnv_u32.o icu52/common/ucnv_u7.o icu52/common/ucnv_u8.o icu52/common/ucnv.o icu52/common/ucnvdisp.o icu52/common/ucnvhz.o icu52/common/ucnvisci.o icu52/common/ucnvlat1.o icu52/common/ucnvmbcs.o icu52/common/ucnvscsu.o icu52/common/udatamem.o icu52/common/udataswp.o icu52/common/uenum.o icu52/common/uhash.o icu52/common/uinvchar.o icu52/common/ulist.o icu52/common/uloc_tag.o icu52/common/umapfile.o icu52/common/umath.o icu52/common/unorm_it.o icu52/common/ures_cnv.o icu52/common/uresdata.o icu52/common/usc_impl.o icu52/common/uscript.o icu52/common/ustr_cnv.o icu52/common/ustrfmt.o icu52/common/utf_impl.o icu52/common/utrace.o icu52/common/utypes.o icu52/common/wintz.o icu52/i18n/alphaindex.o icu52/i18n/anytrans.o icu52/i18n/astro.o icu52/i18n/basictz.o icu52/i18n/bocsu.o icu52/i18n/brktrans.o icu52/i18n/buddhcal.o icu52/i18n/calendar.o icu52/i18n/casetrn.o icu52/i18n/cecal.o icu52/i18n/chnsecal.o icu52/i18n/choicfmt.o icu52/i18n/coleitr.o icu52/i18n/coll.o icu52/i18n/compactdecimalformat.o icu52/i18n/coptccal.o icu52/i18n/cpdtrans.o icu52/i18n/csdetect.o icu52/i18n/csmatch.o icu52/i18n/csr2022.o icu52/i18n/csrecog.o icu52/i18n/csrmbcs.o icu52/i18n/csrsbcs.o icu52/i18n/csrucode.o icu52/i18n/csrutf8.o icu52/i18n/curramt.o icu52/i18n/currfmt.o icu52/i18n/currpinf.o icu52/i18n/currunit.o icu52/i18n/dangical.o icu52/i18n/datefmt.o icu52/i18n/dcfmtsym.o icu52/i18n/decfmtst.o icu52/i18n/decimfmt.o icu52/i18n/digitlst.o icu52/i18n/dtfmtsym.o icu52/i18n/dtitvfmt.o icu52/i18n/dtitvinf.o icu52/i18n/dtptngen.o icu52/i18n/dtrule.o icu52/i18n/esctrn.o icu52/i18n/ethpccal.o icu52/i18n/fmtable_cnv.o icu52/i18n/fmtable.o icu52/i18n/format.o icu52/i18n/fphdlimp.o icu52/i18n/fpositer.o icu52/i18n/funcrepl.o icu52/i18n/gender.o icu52/i18n/gregocal.o icu52/i18n/gregoimp.o icu52/i18n/hebrwcal.o icu52/i18n/identifier_info.o icu52/i18n/indiancal.o icu52/i18n/inputext.o icu52/i18n/islamcal.o icu52/i18n/japancal.o icu52/i18n/locdspnm.o icu52/i18n/measfmt.o icu52/i18n/measure.o icu52/i18n/msgfmt.o icu52/i18n/name2uni.o icu52/i18n/nfrs.o icu52/i18n/nfrule.o icu52/i18n/nfsubs.o icu52/i18n/nortrans.o icu52/i18n/nultrans.o icu52/i18n/numfmt.o icu52/i18n/numsys.o icu52/i18n/olsontz.o icu52/i18n/persncal.o icu52/i18n/plurfmt.o icu52/i18n/plurrule.o icu52/i18n/quant.o icu52/i18n/rbnf.o icu52/i18n/rbt_data.o icu52/i18n/rbt_pars.o icu52/i18n/rbt_rule.o icu52/i18n/rbt_set.o icu52/i18n/rbt.o icu52/i18n/rbtz.o icu52/i18n/regexcmp.o icu52/i18n/regeximp.o icu52/i18n/regexst.o icu52/i18n/regextxt.o icu52/i18n/region.o icu52/i18n/reldtfmt.o icu52/i18n/rematch.o icu52/i18n/remtrans.o icu52/i18n/repattrn.o icu52/i18n/scriptset.o icu52/i18n/search.o icu52/i18n/selfmt.o icu52/i18n/simpletz.o icu52/i18n/smpdtfmt.o icu52/i18n/smpdtfst.o icu52/i18n/sortkey.o icu52/i18n/strmatch.o icu52/i18n/strrepl.o icu52/i18n/stsearch.o icu52/i18n/taiwncal.o icu52/i18n/tblcoll.o icu52/i18n/timezone.o icu52/i18n/titletrn.o icu52/i18n/tmunit.o icu52/i18n/tmutamt.o icu52/i18n/tmutfmt.o icu52/i18n/tolowtrn.o icu52/i18n/toupptrn.o icu52/i18n/translit.o icu52/i18n/transreg.o icu52/i18n/tridpars.o icu52/i18n/tzfmt.o icu52/i18n/tzgnames.o icu52/i18n/tznames_impl.o icu52/i18n/tznames.o icu52/i18n/tzrule.o icu52/i18n/tztrans.o icu52/i18n/ucal.o icu52/i18n/ucol_bld.o icu52/i18n/ucol_cnt.o icu52/i18n/ucol_elm.o icu52/i18n/ucol_res.o icu52/i18n/ucol_sit.o icu52/i18n/ucol_tok.o icu52/i18n/ucol_wgt.o icu52/i18n/ucol.o icu52/i18n/ucoleitr.o icu52/i18n/ucsdet.o icu52/i18n/ucurr.o icu52/i18n/udat.o icu52/i18n/udateintervalformat.o icu52/i18n/udatpg.o icu52/i18n/umsg.o icu52/i18n/unesctrn.o icu52/i18n/uni2name.o icu52/i18n/unum.o icu52/i18n/unumsys.o icu52/i18n/upluralrules.o icu52/i18n/uregex.o icu52/i18n/uregexc.o icu52/i18n/uregion.o icu52/i18n/usearch.o icu52/i18n/uspoof_build.o icu52/i18n/uspoof_conf.o icu52/i18n/uspoof_impl.o icu52/i18n/uspoof_wsconf.o icu52/i18n/uspoof.o icu52/i18n/utrans.o icu52/i18n/vtzone.o icu52/i18n/vzone.o icu52/i18n/windtfmt.o icu52/i18n/winnmfmt.o icu52/i18n/wintzimpl.o icu52/i18n/zonemeta.o icu52/i18n/zrule.o icu52/i18n/ztrans.o icu52/i18n/decContext.o icu52/i18n/decNumber.o icu52/i18n/ucln_in.o icu52/i18n/ulocdata.o icu52/i18n/utmscale.o icu52/stubdata/stubdata.o -L/usr/lib64/R/lib -lR'
DBG: Stderr is '* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
icu52/i18n/ucol_sit.cpp: In function ‘int32_t ucol_getUnsafeSet_52(const UCollator*, USet*, UErrorCode*)’:
icu52/i18n/ucol_sit.cpp:933: warning: ‘int32_t ucol_getContractions_52(const UCollator*, USet*, UErrorCode*)’ is deprecated (declared at icu52/i18n/ucol_sit.cpp:849)
icu52/i18n/ucol_sit.cpp:933: warning: ‘int32_t ucol_getContractions_52(const UCollator*, USet*, UErrorCode*)’ is deprecated (declared at icu52/i18n/ucol_sit.cpp:849)
installing via 'install.libs.R' to /srv/adzuna/value-my-cv/career_explorer/libs/stringi
downloading ICU data library (icudt)
the files will be extracted to: /srv/adzuna/value-my-cv/career_explorer/libs/stringi/libs
no icudt in a local repo
trying URL '/packages/icudt52l.zip'
Content type 'application/zip' length
bytes (9.7 Mb)
opened URL
==================================================
downloaded 9.7 Mb
icudt fetch OK
decompressing downloaded archive
icudt has been installed successfully
restart R to apply changes
** preparing package for lazy loading
*** installing help indices
** building package indices
** testing if installed package can be loaded
How can we tell it to look for the local copy? The output handily includes the remote location () so we can just put it somewhere ourselves but are unsure where.
Maybe we're going about this completely the wrong way but any help or pointers would be welcome.
We're on ubuntu machines and have also tried install libicu42 and libicu-dev but neither of those seemed to help.
3,16452943
Note: for Stringi >= 0.5-1 please check
The stringi package depends on the ICU4C >= 50 library.
So libicu42 is far to old.
If you check
you'll find following lines:
mirrors &- c("/packages/",
"http://www.mini.pw.edu.pl/~gagolews/stringi/",
"http://www.ibspan.waw.pl/~gagolews/stringi/")
you'll find something like this:
if (!grepl("^https?://", href)) {
# try to copy icudt from a local repo
if (!file.exists(href)) return("no icudt in a local repo")
If you add local path at the beginning of the mirrors and put downloaded libraries it seems to work as expected. Here you can a patch I've used:
So my solution would be to:
clone the repostiory
checkout version you want
apply patch with a path to the local version of the ICU
install package from source
There is probably a better way, but that is what I came up so far.
100k20197270
This will be fixed in the upcoming 0.5-1 version of stringi, see .
An appropriate environmental variable (ICUDT_DIR) is now used by the ./configure script to indicate the directory from which a local copy of icudt should be fetched. It can be provided for example via a call to:
install.packages("stringi_0.5-1.zip", # assuming that we install from a downloaded archive
configure.vars="ICUDT_DIR=&dir_to_copy_icudt_from&")
8,67621949
I had the same problem. What I did is similar to the solution proposed by gagolews. Gagolews' solution didn't exactly work for me because I couldn't find a zip copy of stringi to download. I downloaded icudt from
to a folder, say /home/tmp/ then I installed from the net, but providing the local copy of icudt, by typing the following in R:
install.packages("stringi", # this will install from online
configure.vars="ICUDT_DIR=/home/tmp/") #but use the downloaded version of icudt
This worked for me.
2,26711744
Clone the git clone /gagolews/stringi.git.
Edit the .Rbuildignore file and get rid of the ^src/icu55/data line.
Run R CMD build stringi_dir_name to build tar.gz file.
Install the obtained .tar.gz file on your machine(s), e.g.,
via install.packages("stringi_xxx.tar.gz")
This work with R-3.2.3 in Linux Mint 17.2.
1. Install 'libicu-dev' from Software Manager.
2. in R : install.packages('stringi')
For further information, try to read this instruction:
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
rev .25812
Stack Overflow works best with JavaScript enabled一种基于Android系统的语言添加方法
一种基于Android系统的语言添加方法
【专利摘要】本发明公开一种基于Android系统的语言添加方法,该方法简单,便捷,易于实现,使得Android平台可以很好地支持维语等其它小语种。如此一来,Android手机可以很好地在使用维语等小语种的用户人群中推广,使得Android手机真正实现支持所有语言的国际化,既增加了公司的客户群体,也很大程度上推动了Android平台的国际化。
【专利说明】—种基于Android系统的语言添加方法
【技术领域】
[0001]本发明涉及语言添加【技术领域】,尤其涉及一种基于Android系统的语言添加方法。
【背景技术】
[0002]Android系统是一款支持多国语言的手机操作系统,支持多国语言的特性使得Android系统在各地区间传播没有了障碍。但是,目前使用颇广的Android4.2 “果冻豆”系统并不支持维语等其它小语种的显示,致使使用维语的用户无法使用Android手机,造成了 Android手机市场的地域范围无法扩展到维语区域,使得Android手机无法在使用维语的用户中推广,不利于Android系统在全球范围内各区域的推广。
【发明内容】
[0003]本发明的目的在于通过一种基于Android系统的语言添加方法,来解决以上【背景技术】部分提到的问题。
[0004]为达此目的,本发明采用以下技术方案:
[0005]一种基于Android系统的语言添加方法,包括如下步骤:
[0006]A、检查I⑶4C资源是否支持待添加的语言类型,若不支持,则执行步骤B,若支持,则执行步骤C ;
[0007]B、添加与所述待添加的语言类型对应的I⑶4C资源;
[0008]C、编译资源,生成.bat文件;
[0009]D、获取支持所述待添加的语言类型并可用于Android系统的语言资源包;
[0010]E、添加所述待添加的语言类型的字库;
[0011]F、将所述语言类型的字库配置到Android系统中;
[0012]G、在Framework层和各应用中添加所述语言类型的翻译字串;
[0013]H、Android系统配置所述语言类型,编译工程获得支持该语言类型的Android软件。
[0014]特别地,所述步骤C具体包括:在external/I⑶4C下建立临时目录icuBuild,进A icuBuild 目录;执行 icuConfigureRun Linux 命令,生成 make 文件/./ runConf i gur e I CULinux ;执行 make - j2 命令,生成 dat 文件 make - j2 ;复制 external/ICU4C/icuBuild/data/out/tmp/icudt481.dat 文件到 stubdata 下,并改名 icudt481_all.dat,覆盖原有的同名文件;重新配置环境变量,为下一步执行脚本做准备;进入icMc/stubdata,执行脚本,重新生成.dat文件,其中,生成的icudt481_default.dat即为被Android系统使用的添加了所述语言类型资源的文件。
[0015]特别地,所述步骤G具体包括:对frameworks/base/core/res/res做翻译,在此文件夹中添加values-ug-rCN文件夹,并把翻译好的所述语言类型的字串放到此文件夹下;对每个app做翻译,在每个app对应的res目录下建立values-ug-rCN文件夹,并把翻译好的所述语言类型的字串放到此文件夹下。
[0016]特别地,所述步骤H具体包括:在make文件的PR0DUCT_L0CALES字段里,添加所述待添加的语言类型,编译工程获得支持该语言类型的Android软件。
[0017]特别地,所述待添加的语言类型包括维语。
[0018]本发明提出的基于Android系统的语言添加方法简单,便捷,易于实现,使得Android平台可以很好地支持维语等其它小语种。如此一来,Android手机可以很好地在使用维语等小语种的用户人群中推广,使得Android手机真正实现支持所有语言的国际化,既增加了公司的客户群体,也很大程度上推动了 Android平台的国际化。
【专利附图】
【附图说明】
[0019]图1为本发明实施例提供的基于Android系统的语言添加方法流程图。
【具体实施方式】
[0020]下面结合附图和实施例对本发明作进一步说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部内容。
[0021]请参照图1所示,图1为本发明实施例提供的基于Android系统的语言添加方法流程图。
[0022]本实施例中基于Android系统的语言添加方法具体包括如下步骤:
[0023]步骤S101、检查I⑶4C资源是否支持待添加的语言类型,若不支持,则执行步骤S102,若支持,则执行步骤S103。
[0024]ICU4C提供了 C/C++平台强大的国际化开发能力,几乎可以使用帮助解决任何国际化的问题。可以根据各地的风俗和语言习惯,实现对数字、货币、时间、日期、和消息的格式化、解析,对字符串进行大小写转换、整理、搜索和排序等功能,必须一提的是,ICU4C使用了强大的BIDI算法,对阿拉伯语、维语等BIDI语言提供了完善的支持。Android平台就是使用ICU4C来实现多国语言中时间、日期等的显示问题的。
[0025]步骤S103、添加与所述待添加的语言类型对应的I⑶4C资源。
[0026]以所述待添加的语言类型为维语为例。目前ICU4C中并不支持维语,所以首先要对ICU4C添加维语资源的,使得它支持维语显示。
[0027]Android 系统中,ICU4C 资源存放位置是 external\ICU4C。ICU4C 文件夹下 data文件夹中存放多国语言的资源。参照阿拉伯语资源(ar.txt ar_AE.txt)添加维语资源(ug.txt ug_CN.txt)。在 data\coll\resfiles.mk 中配置维语,使得维语资源(ug.txt ug_CN.txt)可以被编译成res资源文件。lang、locales、region、zone文件夹下按照相同方法,添加维语资源。IQJ4C\stubdata\icudt481-default.txt中添加维语资源。填写内存根据data下对应的维语资源文件。完成以上操作后,ICU4C中维语资源的添加与配置工作已经完成。但这样的资源并不能被Android系统使用。Android系统使用的I⑶4C资源需要编译进icudt481_default.dat才可以被Android识别并使用。
[0028]步骤S104、编译资源,生成.bat文件。以所述待添加的语言类型为维语为例,具体步骤如下:[0029]一、在 external/ICU4C 下建立临时目录 icuBuild,进入 icuBuild 目录
[0030]mkdir external/icu4c/icuBuild
[0031]cd external/icu4c/icuBuild
[0032]二、执行 icuConfigureRun Linux 命令,生成 make 文件
[0033]/./runConfigur e I CU Linux
[0034]三、执行make - j2命令,生成dat文件
[0035]make - j2
[0036]四、复制external/ICU4C/icuBuild/data/out/tmp/icudt481.dat 文件到stubdata下,并改名icudt481_all.dat,覆盖原有的同名文件。
[0037]五、重新配置环境变量,为下一步执行脚本做准备。
[0038]export
[0039]ANDROID_EABI_TOOLCHAIN = /XXXX/ProjectPath/prebuilts/gcc/linux-x86
[0040]/arm/arm-eab1-4.6/bin
[0041]export
[0042]LD—LIBRARY—PATH = /XXXX/Pro jectPath/prebui lts/mi sc/1 inux~x86_64/ic
[0043]u-4.8
[0044]export ANDROID—BUILD—TOP = /XXXX/Pro jectPath
[0045]六、进入icu4c/stubdata,执行脚本,重新生成.dat文件。
[0046]./icu—dat—generator, py
[0047]其中,生成的icudt481_default.dat即为被Android系统使用的添加了维语资源的文件。另外,以上操作均在在Iinux环境下执行。
[0048]步骤S105、获取支持所述待添加的语言类型并可用于Android系统的语言资源包。
[0049]步骤S106、添加所述待添加的语言类型的字库。具体步骤如下:
[0050]1、复制维语字库文件到frameworks/base/data/fonts下,将ug.ttf复制到这个目录下。
[0051]2、在 frameworks\base\data\font\fallback—fonts, xml 中添加
【权利要求】
1.一种基于Android系统的语言添加方法,其特征在于,包括如下步骤:
A、检查ICU4C资源是否支持待添加的语言类型,若不支持,则执行步骤B,若支持,则执行步骤C ;
B、添加与所述待添加的语言类型对应的ICU4C资源;
C、编译资源,生成.bat文件;
D、获取支持所述待添加的语言类型并可用于Android系统的语言资源包;
E、添加所述待添加的语言类型的字库;
F、将所述语言类型的字库配置到Android系统中;
G、在Framework层和各应用中添加所述语言类型的翻译字串;
H、Android系统配置所述语言类型,编译工程获得支持该语言类型的Android软件。
2.根据权利要求1所述基于Android系统的语言添加方法,其特征在于,所述步骤C具体包括:在external/IQJ4C下建立临时目录icuBuild,进入icuBuild目录;执行icuConfigureRun Linux 命令,生成 make 文件/./runConfigur e I CU L执#于 make _ j2命令,生成 dat 文件 make - j2 ;复制 external/ICU4C/icuBuild/data/out/tmp/icudt481.dat文件到stubdata下,并改名icudt481_all.dat,覆盖原有的同名文件;重新配置环境变量,为下一步执行脚本做准备;进入icu4c/stubdata,执行脚本,重新生成.dat文件,其中,生成的icudt481_default.dat即为被Android系统使用的添加了所述语言类型资源的文件。
3.根据权利要求2所述基于Android系统的语言添加方法,其特征在于,所述步骤G具体包括:对frameworks/base/core/res/res做翻译,在此文件夹中添加values-ug-rCN文件夹,并把翻译好的所述语言类型的字串放到此文件夹下;对每个app做翻译,在每个app对应的res目录下建立values-ug-rCN文件夹,并把翻译好的所述语言类型的字串放到此文件夹下。
4.根据权利要求3所述基于Android系统的语言添加方法,其特征在于,所述步骤H具体包括:在make文件的PRODUCT_LOCALES字段里,添加所述待添加的语言类型,编译工程获得支持该语言类型的Android软件。
5.根据权利要求1至4之一所述基于Android系统的语言添加方法,其特征在于,所述待添加的语言类型包括维语。
【文档编号】G06F9/45GKSQ
【公开日】日
申请日期:日
优先权日:日
【发明者】王浩
申请人:无锡久源软件科技有限公司}

我要回帖

更多关于 手机突然不能打字了 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信