recovery 界面汉化过程详解

本文详细介绍了如何对recovery界面进行汉化,重点讲述了使用unicode编码进行汉化的步骤,包括修改default_device.cpp实现主界面汉化,获取并使用unicode字库,以及在minui/Android.mk中设置编译选项,确保界面显示为中文。
摘要由CSDN通过智能技术生成

一. 主要是针对recovery汉化,主要汉化对象是界面显示为中文。


二. 基于中文的汉化,有两种方式,一种是基于GB2312的编码格式汉化,另外一种是基于unicode编码格式汉化。下面介绍unicode中文汉化。


三. 汉化主要需要修改四个文件,汉化步骤:

    3.1 default_device.cpp修改,主界面汉化

             

         增加中文的界面,但是由于是unicode编码,所以在source insight里面显示乱码:

       


         这些看似乱码,我们可以这样获取,桌面新建txt文档,使用notepad++工具打开, 选择格式,以UTF-8 无BOM格式编码,里面写入需要显示的汉字,然后保存,然后把新建的txt使用source insight打开即可。

          

          

          


    3.2 unicode的中文字库获取,网上可以下载, eg:fontcn30_18x48.h

          


    3.3 针对unicode的解析源文件graphics_cn.c

 

/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>

#include <fcntl.h>
#include <stdio.h>

#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/types.h>

#include
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值