|
| 1 | +const { t } = require("../locales"); |
1 | 2 | module.exports = () => ({
|
2 |
| - title: "二分法", |
| 3 | + // title: "二分法", |
| 4 | + title: t("Locale.codeTemplate.binarySearch.title"), |
3 | 5 | logo: require("../imgs/half.svg"),
|
4 | 6 | list: [
|
5 | 7 | {
|
6 |
| - text: "查找一个数", |
| 8 | + // text: "查找一个数", |
| 9 | + text: t("Locale.codeTemplate.binarySearch.item1"), |
7 | 10 | problems: [
|
8 | 11 | {
|
9 | 12 | id: "single-element-in-a-sorted-array",
|
10 |
| - title: "540. 有序数组中的单一元素", |
| 13 | + // title: "540. 有序数组中的单一元素", |
| 14 | + title: t("Locale.problem.540"), |
11 | 15 | },
|
12 | 16 | ],
|
13 | 17 | codes: [
|
@@ -92,15 +96,18 @@ module.exports = () => ({
|
92 | 96 | ],
|
93 | 97 | },
|
94 | 98 | {
|
95 |
| - text: "寻找最左边的满足条件的值", |
| 99 | + // text: "寻找最左边的满足条件的值", |
| 100 | + text: t("Locale.codeTemplate.binarySearch.item2"), |
96 | 101 | problems: [
|
97 | 102 | {
|
98 | 103 | id: "find-first-and-last-position-of-element-in-sorted-array",
|
99 |
| - title: "34. 在排序数组中查找元素的第一个和最后一个位置", |
| 104 | + // title: "34. 在排序数组中查找元素的第一个和最后一个位置", |
| 105 | + title: t("Locale.problem.34"), |
100 | 106 | },
|
101 | 107 | {
|
102 | 108 | id: "first-bad-version",
|
103 |
| - title: "278. 第一个错误的版本", |
| 109 | + // title: "278. 第一个错误的版本", |
| 110 | + title: t("Locale.problem.278"), |
104 | 111 | },
|
105 | 112 | ],
|
106 | 113 | codes: [
|
@@ -194,15 +201,18 @@ module.exports = () => ({
|
194 | 201 | ],
|
195 | 202 | },
|
196 | 203 | {
|
197 |
| - text: "寻找最右边的满足条件的值", |
| 204 | + // text: "寻找最右边的满足条件的值", |
| 205 | + text: t("Locale.codeTemplate.binarySearch.item3"), |
198 | 206 | problems: [
|
199 | 207 | {
|
200 | 208 | id: "find-first-and-last-position-of-element-in-sorted-array",
|
201 |
| - title: "34. 在排序数组中查找元素的第一个和最后一个位置", |
| 209 | + // title: "34. 在排序数组中查找元素的第一个和最后一个位置", |
| 210 | + title: t("Locale.problem.34"), |
202 | 211 | },
|
203 | 212 | {
|
204 | 213 | id: "sqrtx",
|
205 |
| - title: "69. x 的平方根", |
| 214 | + // title: "69. x 的平方根", |
| 215 | + title: t("Locale.problem.69"), |
206 | 216 | },
|
207 | 217 | ],
|
208 | 218 | codes: [
|
@@ -297,7 +307,8 @@ module.exports = () => ({
|
297 | 307 | ],
|
298 | 308 | },
|
299 | 309 | {
|
300 |
| - text: "寻找最左插入位置", |
| 310 | + // text: "寻找最左插入位置", |
| 311 | + text: t("Locale.codeTemplate.binarySearch.item4"), |
301 | 312 | codes: [
|
302 | 313 | {
|
303 | 314 | language: "py",
|
@@ -344,12 +355,14 @@ function searchInsertLeft(nums, x) {
|
344 | 355 | problems: [
|
345 | 356 | {
|
346 | 357 | id: "random-pick-with-weight",
|
347 |
| - title: "528. 按权重随机选择", |
| 358 | + // title: "528. 按权重随机选择", |
| 359 | + title: t("Locale.problem.528"), |
348 | 360 | },
|
349 | 361 | ],
|
350 | 362 | },
|
351 | 363 | {
|
352 |
| - text: "寻找最右插入位置", |
| 364 | + // text: "寻找最右插入位置", |
| 365 | + text: t("Locale.codeTemplate.binarySearch.item5"), |
353 | 366 | codes: [
|
354 | 367 | {
|
355 | 368 | language: "py",
|
@@ -395,7 +408,8 @@ function searchInsertRight(nums, x) {
|
395 | 408 | problems: [
|
396 | 409 | {
|
397 | 410 | id: "find-first-and-last-position-of-element-in-sorted-array",
|
398 |
| - title: "34. 在排序数组中查找元素的第一个和最后一个位置", |
| 411 | + // title: "34. 在排序数组中查找元素的第一个和最后一个位置", |
| 412 | + title: t("Locale.problem.34"), |
399 | 413 | },
|
400 | 414 | ],
|
401 | 415 | },
|
|
0 commit comments