Skip to content

Commit a4428fb

Browse files
authored
Merge pull request #451 from AgoraIO/dev/android_chinese_strings
[Android] Replace Chinese comments.
2 parents 9b125cd + d60bcd6 commit a4428fb

File tree

66 files changed

+320
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+320
-330
lines changed

Android/APIExample-Audio/app/src/main/java/io/agora/api/example/common/widget/WaveformView.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ private void init(AttributeSet attrs, int defStyle) {
6969

7070
private void initPainters() {
7171
mWavePaint = new Paint();
72-
mWavePaint.setColor(mWaveColor);// 画笔为color
73-
mWavePaint.setStrokeWidth(waveStrokeWidth);// 设置画笔粗细
72+
mWavePaint.setColor(mWaveColor);// Set paint color
73+
mWavePaint.setStrokeWidth(waveStrokeWidth);// Set paint stroke width
7474
mWavePaint.setAntiAlias(true);
7575
mWavePaint.setFilterBitmap(true);
7676
mWavePaint.setStrokeCap(Paint.Cap.ROUND);
7777
mWavePaint.setStyle(Paint.Style.FILL);
7878
Shader shader = new LinearGradient(0, 0, 1000, 0, 0xffffffff, 0xFFe850ee, Shader.TileMode.CLAMP);
7979
mWavePaint.setShader(shader);
8080
baseLinePaint = new Paint();
81-
baseLinePaint.setColor(mBaseLineColor);// 画笔为color
82-
baseLinePaint.setStrokeWidth(1f);// 设置画笔粗细
81+
baseLinePaint.setColor(mBaseLineColor);// Set paint color
82+
baseLinePaint.setStrokeWidth(1f);// Set paint stroke width
8383
baseLinePaint.setAntiAlias(true);
8484
baseLinePaint.setFilterBitmap(true);
8585
baseLinePaint.setStyle(Paint.Style.FILL);
@@ -145,7 +145,7 @@ public void setMaxConstant(boolean maxConstant) {
145145
}
146146

147147
/**
148-
* 如果改变相应配置 需要刷新相应的paint设置
148+
* If you change the corresponding configuration, you need to refresh the paint settings
149149
*/
150150
public void invalidateNow() {
151151
initPainters();

Android/APIExample-Audio/app/src/main/java/io/agora/api/example/utils/DefaultPoolExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Executors
1717
*
1818
* @version 1.0
19-
* @since 16/4/28 下午4:07
19+
* @since 16/4/28 4:07 PM
2020
*/
2121
public class DefaultPoolExecutor extends ThreadPoolExecutor
2222
{

Android/APIExample-Audio/app/src/main/java/io/agora/api/example/utils/DefaultThreadFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* @author zhilong <a href="mailto:[email protected]">Contact me.</a>
1414
* @version 1.0
15-
* @since 15/12/25 上午10:51
15+
* @since 15/12/25 10:51 AM
1616
*/
1717
public class DefaultThreadFactory implements ThreadFactory
1818
{

Android/APIExample-Audio/app/src/main/java/io/agora/api/example/utils/FileUtils.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,27 @@ public static void copyFilesFromAssets(Context context, String assetsPath, Strin
3232
AssetManager assetManager = context.getAssets();
3333
try {
3434
File file = new File(storagePath);
35-
if (!file.exists()) {//如果文件夹不存在,则创建新的文件夹
35+
if (!file.exists()) {//If the folder does not exist, create a new folder
3636
file.mkdirs();
3737
}
3838

39-
// 获取assets目录下的所有文件及目录名
39+
// Get all file and directory names under assets
4040
String[] fileNames = assetManager.list(assetsPath);
41-
if (fileNames.length > 0) {//如果是目录 apk
41+
if (fileNames.length > 0) {//If it's a directory
4242
for (String fileName : fileNames) {
4343
if (!TextUtils.isEmpty(assetsPath)) {
44-
temp = assetsPath + SEPARATOR + fileName;//补全assets资源路径
44+
temp = assetsPath + SEPARATOR + fileName;//Complete assets resource path
4545
}
4646

4747
String[] childFileNames = assetManager.list(temp);
48-
if (!TextUtils.isEmpty(temp) && childFileNames.length > 0) {//判断是文件还是文件夹:如果是文件夹
48+
if (!TextUtils.isEmpty(temp) && childFileNames.length > 0) {//Check if it's a file or folder: if it's a folder
4949
copyFilesFromAssets(context, temp, storagePath + SEPARATOR + fileName);
50-
} else {//如果是文件
50+
} else {//If it's a file
5151
InputStream inputStream = assetManager.open(temp);
5252
readInputStream(storagePath + SEPARATOR + fileName, inputStream);
5353
}
5454
}
55-
} else {//如果是文件 doc_test.txt或者apk/app_test.apk
55+
} else {//If it's a file like doc_test.txt or apk/app_test.apk
5656
InputStream inputStream = assetManager.open(assetsPath);
5757
if (assetsPath.contains(SEPARATOR)) {//apk/app_test.apk
5858
assetsPath = assetsPath.substring(assetsPath.lastIndexOf(SEPARATOR), assetsPath.length());
@@ -66,27 +66,27 @@ public static void copyFilesFromAssets(Context context, String assetsPath, Strin
6666
}
6767

6868
/**
69-
* 读取输入流中的数据写入输出流
69+
* Read data from input stream and write to output stream
7070
*
71-
* @param storagePath 目标文件路径
72-
* @param inputStream 输入流
71+
* @param storagePath Target file path
72+
* @param inputStream Input stream
7373
*/
7474
public static void readInputStream(String storagePath, InputStream inputStream) {
7575
File file = new File(storagePath);
7676
try {
7777
if (!file.exists()) {
78-
// 1.建立通道对象
78+
// 1. Create channel object
7979
FileOutputStream fos = new FileOutputStream(file);
80-
// 2.定义存储空间
80+
// 2. Define storage space
8181
byte[] buffer = new byte[inputStream.available()];
82-
// 3.开始读文件
82+
// 3. Start reading file
8383
int lenght = 0;
84-
while ((lenght = inputStream.read(buffer)) != -1) {// 循环从输入流读取buffer字节
85-
// 将Buffer中的数据写到outputStream对象中
84+
while ((lenght = inputStream.read(buffer)) != -1) {// Read buffer bytes from input stream in a loop
85+
// Write data from Buffer to outputStream object
8686
fos.write(buffer, 0, lenght);
8787
}
88-
fos.flush();// 刷新缓冲区
89-
// 4.关闭流
88+
fos.flush();// Flush buffer
89+
// 4. Close streams
9090
fos.close();
9191
inputStream.close();
9292
}

Android/APIExample-Audio/app/src/main/java/io/agora/api/example/utils/YUVUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public static byte[] toWrappedI420(ByteBuffer bufferY,
184184
return out;
185185
}
186186
/**
187-
* I420转nv21
187+
* Convert I420 to NV21
188188
*/
189189
public static byte[] I420ToNV21(byte[] data, int width, int height) {
190190
byte[] ret = new byte[data.length];

Android/APIExample-Audio/app/src/main/res/layout/fragment_ready_layout.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
android:layout_marginTop="24dp"
1313
android:layout_marginEnd="24dp"
1414
android:textSize="17sp"
15-
android:text="此示例演示了如何使用SDK进行语音通话的功能。"/>
15+
android:text="@string/the_example_feature_tips"/>
1616

1717
<androidx.appcompat.widget.AppCompatButton
1818
android:id="@+id/next"

Android/APIExample-Audio/app/src/main/res/values-zh/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,5 @@
8686
<string name="audio_route_headset_typec">耳机(TypeC)</string>
8787
<string name="audio_route_headset_bluetooth">蓝牙耳机</string>
8888
<string name="notifications_enable_tip">请打开通知权限,防止后台录音中断</string>
89+
<string name="the_example_feature_tips">此示例演示了如何使用SDK进行语音通话的功能。</string>
8990
</resources>

Android/APIExample-Audio/app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,5 @@
9494
<string name="audio_route_headset_typec">headset(TypeC)</string>
9595
<string name="audio_route_headset_bluetooth">bluetooth headset</string>
9696
<string name="notifications_enable_tip">Please turn on notification permission to prevent background recording from being interrupted.</string>
97+
<string name="the_example_feature_tips">This example demonstrates how to use the SDK to implement voice call functionality.</string>
9798
</resources>

Android/APIExample-Compose/app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ android {
3535
properties.load(rootProject.file("local.properties").inputStream())
3636
val AGORA_APP_ID = properties.getProperty("AGORA_APP_ID", "")
3737
if (AGORA_APP_ID == "") {
38-
throw GradleException("请在项目根目录下local.properties文件里正确配置:AGORA_APP_ID=<您的声网AppId>")
38+
throw GradleException("Please configure correctly in the local.properties file in the project root directory: AGORA_APP_ID=<Your Agora AppId>")
3939
}
4040
val AGORA_APP_CERT = properties.getProperty("AGORA_APP_CERT", "")
4141
buildConfigField("String", "AGORA_APP_ID", "\"$AGORA_APP_ID\"")

Android/APIExample-Compose/app/src/main/java/io/agora/api/example/compose/samples/ChannelEncryption.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ fun ChannelEncryption() {
172172
val allGranted = grantedMap.values.all { it }
173173
if (allGranted) {
174174
// Permission is granted
175-
Toast.makeText(context, "Permission Granted", Toast.LENGTH_LONG).show()
175+
Toast.makeText(context, R.string.permission_granted, Toast.LENGTH_LONG).show()
176176

177177
val encryptionConfig = EncryptionConfig()
178178
encryptionConfig.encryptionMode = encryptionMode
@@ -194,7 +194,7 @@ fun ChannelEncryption() {
194194
}
195195
} else {
196196
// Permission is denied
197-
Toast.makeText(context, "Permission Denied", Toast.LENGTH_LONG).show()
197+
Toast.makeText(context, R.string.permission_denied, Toast.LENGTH_LONG).show()
198198
}
199199
}
200200

0 commit comments

Comments
 (0)