From 7640147a07fce7056a783ee7f7f7302cf9108391 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Tue, 2 Feb 2021 20:14:29 +0100 Subject: [PATCH] feat: curriculum dictionaries to objects (#40878) * test: update to catch missing comments * feat: convert dictionaries to JSON objects * chore: update dictionaries * fix: update tests for new dictionary objects * fix: convert fixture to json * fix: updated the incomplete dicts to new format --- .../dictionaries/chinese/comments.json | 14 +- .../english/comments-to-not-translate.js | 12 - .../english/comments-to-not-translate.json | 4 + .../dictionaries/english/comments.json | 14 +- .../dictionaries/spanish/comments.json | 14 +- .../incomplete-dicts/chinese/comments.json | 4 + .../english/comments-to-not-translate.json | 4 + .../incomplete-dicts/english/comments.json | 4 + .../incomplete-dicts/spanish/comments.json | 3 + curriculum/dictionaries/chinese/comments.json | 544 ++++-------------- .../english/comments-to-not-translate.js | 51 -- .../english/comments-to-not-translate.json | 7 + curriculum/dictionaries/english/comments.json | 544 ++++-------------- curriculum/dictionaries/espanol/comments.json | 544 ++++-------------- curriculum/getChallenges.js | 41 +- curriculum/getChallenges.test.js | 11 + 16 files changed, 399 insertions(+), 1416 deletions(-) delete mode 100644 curriculum/__fixtures__/dictionaries/english/comments-to-not-translate.js create mode 100644 curriculum/__fixtures__/dictionaries/english/comments-to-not-translate.json create mode 100644 curriculum/__fixtures__/incomplete-dicts/chinese/comments.json create mode 100644 curriculum/__fixtures__/incomplete-dicts/english/comments-to-not-translate.json create mode 100644 curriculum/__fixtures__/incomplete-dicts/english/comments.json create mode 100644 curriculum/__fixtures__/incomplete-dicts/spanish/comments.json delete mode 100644 curriculum/dictionaries/english/comments-to-not-translate.js create mode 100644 curriculum/dictionaries/english/comments-to-not-translate.json diff --git a/curriculum/__fixtures__/dictionaries/chinese/comments.json b/curriculum/__fixtures__/dictionaries/chinese/comments.json index 1423d8a460..12abcf86c4 100644 --- a/curriculum/__fixtures__/dictionaries/chinese/comments.json +++ b/curriculum/__fixtures__/dictionaries/chinese/comments.json @@ -1,10 +1,4 @@ -[ - { - "id": "hyek8f", - "text": "Chinese translation one" - }, - { - "id": "rscjup", - "text": "Chinese translation two" - } -] +{ + "hyek8f": "Chinese translation one", + "rscjup": "Chinese translation two" +} diff --git a/curriculum/__fixtures__/dictionaries/english/comments-to-not-translate.js b/curriculum/__fixtures__/dictionaries/english/comments-to-not-translate.js deleted file mode 100644 index d37ef23333..0000000000 --- a/curriculum/__fixtures__/dictionaries/english/comments-to-not-translate.js +++ /dev/null @@ -1,12 +0,0 @@ -const COMMENTS_TO_NOT_TRANSLATE = [ - { - id: 'rms15q', - text: 'Not translated one' - }, - { - id: '78gz3i', - text: 'Not translated two' - } -]; - -exports.COMMENTS_TO_NOT_TRANSLATE = COMMENTS_TO_NOT_TRANSLATE; diff --git a/curriculum/__fixtures__/dictionaries/english/comments-to-not-translate.json b/curriculum/__fixtures__/dictionaries/english/comments-to-not-translate.json new file mode 100644 index 0000000000..d8ead2e799 --- /dev/null +++ b/curriculum/__fixtures__/dictionaries/english/comments-to-not-translate.json @@ -0,0 +1,4 @@ +{ + "rms15q": "Not translated one", + "78gz3i": "Not translated two" +} diff --git a/curriculum/__fixtures__/dictionaries/english/comments.json b/curriculum/__fixtures__/dictionaries/english/comments.json index 71b34d9b59..ba1458714f 100644 --- a/curriculum/__fixtures__/dictionaries/english/comments.json +++ b/curriculum/__fixtures__/dictionaries/english/comments.json @@ -1,10 +1,4 @@ -[ - { - "id": "hyek8f", - "text": "To be translated one" - }, - { - "id": "rscjup", - "text": "To be translated two" - } -] +{ + "hyek8f": "To be translated one", + "rscjup": "To be translated two" +} diff --git a/curriculum/__fixtures__/dictionaries/spanish/comments.json b/curriculum/__fixtures__/dictionaries/spanish/comments.json index 0e06b63ff8..abd568029e 100644 --- a/curriculum/__fixtures__/dictionaries/spanish/comments.json +++ b/curriculum/__fixtures__/dictionaries/spanish/comments.json @@ -1,10 +1,4 @@ -[ - { - "id": "hyek8f", - "text": "Spanish translation one" - }, - { - "id": "rscjup", - "text": "Spanish translation two" - } -] +{ + "hyek8f": "Spanish translation one", + "rscjup": "Spanish translation two" +} diff --git a/curriculum/__fixtures__/incomplete-dicts/chinese/comments.json b/curriculum/__fixtures__/incomplete-dicts/chinese/comments.json new file mode 100644 index 0000000000..12abcf86c4 --- /dev/null +++ b/curriculum/__fixtures__/incomplete-dicts/chinese/comments.json @@ -0,0 +1,4 @@ +{ + "hyek8f": "Chinese translation one", + "rscjup": "Chinese translation two" +} diff --git a/curriculum/__fixtures__/incomplete-dicts/english/comments-to-not-translate.json b/curriculum/__fixtures__/incomplete-dicts/english/comments-to-not-translate.json new file mode 100644 index 0000000000..d8ead2e799 --- /dev/null +++ b/curriculum/__fixtures__/incomplete-dicts/english/comments-to-not-translate.json @@ -0,0 +1,4 @@ +{ + "rms15q": "Not translated one", + "78gz3i": "Not translated two" +} diff --git a/curriculum/__fixtures__/incomplete-dicts/english/comments.json b/curriculum/__fixtures__/incomplete-dicts/english/comments.json new file mode 100644 index 0000000000..ba1458714f --- /dev/null +++ b/curriculum/__fixtures__/incomplete-dicts/english/comments.json @@ -0,0 +1,4 @@ +{ + "hyek8f": "To be translated one", + "rscjup": "To be translated two" +} diff --git a/curriculum/__fixtures__/incomplete-dicts/spanish/comments.json b/curriculum/__fixtures__/incomplete-dicts/spanish/comments.json new file mode 100644 index 0000000000..545a659e36 --- /dev/null +++ b/curriculum/__fixtures__/incomplete-dicts/spanish/comments.json @@ -0,0 +1,3 @@ +{ + "hyek8f": "Spanish translation one" +} diff --git a/curriculum/dictionaries/chinese/comments.json b/curriculum/dictionaries/chinese/comments.json index 4b0617e99c..1762add2e3 100644 --- a/curriculum/dictionaries/chinese/comments.json +++ b/curriculum/dictionaries/chinese/comments.json @@ -1,434 +1,110 @@ -[ - { - "id": "hyek8f", - "text": "24.44 摄氏度" - }, - { - "id": "rscjup", - "text": "26 摄氏度" - }, - { - "id": "am2xch", - "text": "一个展示需要完成的任务的字符串列表:" - }, - { - "id": "6rztdg", - "text": "在这里添加一条记录" - }, - { - "id": "to1vwe", - "text": "在这里添加 handleChange() 和 submitMessage() 方法" - }, - { - "id": "31b7ey", - "text": "在这行上面添加代码" - }, - { - "id": "c24by8", - "text": "在这行下面添加代码" - }, - { - "id": "jbrt8k", - "text": "添加第 m 行到 newArray" - }, - { - "id": "zkh12d", - "text": "使用 myString 通过挑战后,了解分组如何运行" - }, - { - "id": "mobihi", - "text": "给 oopsGlobal 赋值 5" - }, - { - "id": "v3ups9", - "text": "调用 scale,传入一个参数" - }, - { - "id": "iw4a3a", - "text": "示例 1:Target 没有子级" - }, - { - "id": "463xp8", - "text": "示例 2:Target 有一个子级" - }, - { - "id": "u3inrm", - "text": "示例 3:Target 有两个子级" - }, - { - "id": "axnbgg", - "text": "修改这行上面的代码" - }, - { - "id": "i2kck7", - "text": "修改这行下面的代码" - }, - { - "id": "dlbobn", - "text": "修改这一行" - }, - { - "id": "v127zb", - "text": "检查两个控制台的差异。freeCodeCamp 控制台应该打印两次变量,分别对应这个挑战的每一个测试。浏览器控制台应该只打印一次变量,因为你清除了第一次的打印结果。" - }, - { - "id": "ejm0ql", - "text": "关闭视频窗口的第三个选项卡,并合并" - }, - { - "id": "iwch6t", - "text": "完成下面的方法,其余的执行类似" - }, - { - "id": "hihhyz", - "text": "完成 return 语句" - }, - { - "id": "sdxti5", - "text": "计数 target 的子节点,并删掉" - }, - { - "id": "wfw6sc", - "text": "创建 x 和 y 轴" - }, - { - "id": "sjw6f4", - "text": "在这里创建轴" - }, - { - "id": "nupsh2", - "text": "创建一个二维数组,有 m 行 n 列,元素均为 0" - }, - { - "id": "xfjb3s", - "text": "在这行下面声明 myGlobal 变量" - }, - { - "id": "htpjk7", - "text": "为 decrement action types 定义一个常量" - }, - { - "id": "tfzdsp", - "text": "为 increment action types 定义一个常量" - }, - { - "id": "zh20mi", - "text": "定义 ADD、addMessage()、messageReducer() 并在这里存储:" - }, - { - "id": "43qs4c", - "text": "为自减运算定义一个动作创建器" - }, - { - "id": "nen3qo", - "text": "为自增运算定义一个动作创建器" - }, - { - "id": "0cwyam", - "text": "在这里定义一个动作创建器:" - }, - { - "id": "fq0wsg", - "text": "在这里定义一个动作" - }, - { - "id": "tegkqa", - "text": "在这里定义 Container 组件:" - }, - { - "id": "b5oihn", - "text": "定义 counter reducer,根据接收到的动作递增或递减 state" - }, - { - "id": "91y4pd", - "text": "在这里定义 Redux store,传入 reducers" - }, - { - "id": "eie1vk", - "text": "在这里定义 root reducer" - }, - { - "id": "5s7nnl", - "text": "在这里定义 store here:" - }, - { - "id": "34qe2q", - "text": "字典将包含集合的元素" - }, - { - "id": "2c1wra", - "text": "在这里发送接收到的 data action" - }, - { - "id": "923cpg", - "text": "在这里发送 request action" - }, - { - "id": "picsyf", - "text": "在这里发送 action:" - }, - { - "id": "ysjr1s", - "text": "显示代码" - }, - { - "id": "kjd1am", - "text": "这里不能修改 state,否则测试不能通过" - }, - { - "id": "5tx4ow", - "text": "娱乐网站" - }, - { - "id": "9yu58b", - "text": "示例库存清单" - }, - { - "id": "ciddtb", - "text": "找到目标值及其父级" - }, - { - "id": "ixx548", - "text": "修改下方代码,使其结果为 true" - }, - { - "id": "6mbhjj", - "text": "例如:Redux.createStore()" - }, - { - "id": "jshtzq", - "text": "函数返回表示“一杯红茶(black tea)”的字符串" - }, - { - "id": "cw1ghf", - "text": "函数返回表示“一杯绿茶(green tea)”的字符串" - }, - { - "id": "iuccln", - "text": "返回一个随机填充的数组" - }, - { - "id": "bm2mop", - "text": "点击之后获取 tabs" - }, - { - "id": "kchz5k", - "text": "点击之前获取 tabs" - }, - { - "id": "bfd23c", - "text": "有一个函数(代表茶的种类)和需要几杯茶,下面的函数返回一个数组,包含字符串(每个字符串表示一杯特别种类的茶)。" - }, - { - "id": "ead98i", - "text": "全局 count 变量:" - }, - { - "id": "7zf0i2", - "text": "将它们合并起来" - }, - { - "id": "5j2l88", - "text": "我们创建三个浏览器窗口" - }, - { - "id": "e843r9", - "text": "我们现在打开一个新的选项卡" - }, - { - "id": "5fvehh", - "text": "在 myLocalScope 之外,未定义 myVar" - }, - { - "id": "qn720a", - "text": "现在,在 console.log() 之前添加 console.clear(),清除浏览器控制台的内容,通过测试。" - }, - { - "id": "j86mef", - "text": "现在执行打开选项卡,关闭选项卡和其他操作" - }, - { - "id": "mk7rvy", - "text": "现在移除 console log 这一行,通过测试" - }, - { - "id": "n7vm1s", - "text": "只修改这一行上面的代码" - }, - { - "id": "cvh4x7", - "text": "只修改这一行下面的代码" - }, - { - "id": "lvmnm7", - "text": "打开一个新的选项卡,显示猫的图片" - }, - { - "id": "avpx79", - "text": "打开你的浏览器控制台。" - }, - { - "id": "0b5ps6", - "text": "画布边线和图表之间的 padding" - }, - { - "id": "uemoej", - "text": "将 n 个 0 推入当前行以创建列" - }, - { - "id": "lm86nf", - "text": "将当前行(已有 n 个 0)推送到数组" - }, - { - "id": "qscelx", - "text": "可从 Redux 对象获得 Redux 方法" - }, - { - "id": "atqiig", - "text": "在这一行下面渲染一个输入框(input),按钮(button)和列表(ul)" - }, - { - "id": "yq81wg", - "text": "在这一行下面渲染 Provider" - }, - { - "id": "kxio9j", - "text": "responseFromServer 设置为 false,表示从服务器获得无效响应" - }, - { - "id": "alh6pw", - "text": "responseFromServer 设置为 true,表示从服务器获得有效响应" - }, - { - "id": "1cfidd", - "text": "responseFromServer 表示从服务器获得一个响应" - }, - { - "id": "96tntk", - "text": "返回 30" - }, - { - "id": "58a5g7", - "text": "运行并检查控制台" - }, - { - "id": "71bus9", - "text": "运行测试,查看两个控制台的差异。" - }, - { - "id": "7wp46n", - "text": "设置为华氏刻度" - }, - { - "id": "oefvg5", - "text": "设置" - }, - { - "id": "mnt4d3", - "text": "应该显示 'carrot'" - }, - { - "id": "fhe9m4", - "text": "社交网站" - }, - { - "id": "za434b", - "text": "每周训练的堆积条形图" - }, - { - "id": "7c1fv9", - "text": "堆积条形图在这里显示" - }, - { - "id": "r44ovx", - "text": "tabs 是在窗口中打开的每个站点的 title 的数组" - }, - { - "id": "cl8peb", - "text": "测试数组:" - }, - { - "id": "1xi3cv", - "text": "全局变量" - }, - { - "id": "3gc01a", - "text": "main.scss 文件" - }, - { - "id": "14kfog", - "text": "这是交集方法" - }, - { - "id": "d1shtt", - "text": "这是并集方法" - }, - { - "id": "pqq6sy", - "text": "此方法添加一个元素到集合中" - }, - { - "id": "nd2oxy", - "text": "此方法将检查元素是否存在,并返回 true 或 false" - }, - { - "id": "ocm81t", - "text": "此方法将从集合中删除一个元素" - }, - { - "id": "or9p5p", - "text": "此方法将返回集合中的所有值" - }, - { - "id": "g1608f", - "text": "此方法将返回集合的大小" - }, - { - "id": "bheu99", - "text": "这将保存一个集合" - }, - { - "id": "x1djjr", - "text": "在下一行使用 console.clear(),清除浏览器控制台的内容" - }, - { - "id": "22ta95", - "text": "使用 console.log() 打印输出变量" - }, - { - "id": "w43c7l", - "text": "使用 s = [2, 5, 7] 将无效" - }, - { - "id": "pgckoj", - "text": "变量赋值" - }, - { - "id": "2xiqvv", - "text": "变量声明" - }, - { - "id": "2sx8zg", - "text": "我们记录对象内部的数组" - }, - { - "id": "xmjfd8", - "text": "当你关闭一个选项卡时" - }, - { - "id": "es69h6", - "text": "当你将两个窗口合并为一个窗口时" - }, - { - "id": "fho5t5", - "text": "当你在最后打开一个选项卡时" - }, - { - "id": "00kcrm", - "text": "输出 true" - }, - { - "id": "sxpg2a", - "text": "你的邮箱、Google Drive 和其他工作地点" - } -] +{ + "hyek8f": "24.44 摄氏度", + "rscjup": "26 摄氏度", + "am2xch": "一个展示需要完成的任务的字符串列表:", + "6rztdg": "在这里添加一条记录", + "to1vwe": "在这里添加 handleChange() 和 submitMessage() 方法", + "31b7ey": "在这行上面添加代码", + "c24by8": "在这行下面添加代码", + "jbrt8k": "添加第 m 行到 newArray", + "zkh12d": "使用 myString 通过挑战后,了解分组如何运行", + "mobihi": "给 oopsGlobal 赋值 5", + "v3ups9": "调用 scale,传入一个参数", + "iw4a3a": "示例 1:Target 没有子级", + "463xp8": "示例 2:Target 有一个子级", + "u3inrm": "示例 3:Target 有两个子级", + "axnbgg": "修改这行上面的代码", + "i2kck7": "修改这行下面的代码", + "dlbobn": "修改这一行", + "v127zb": "检查两个控制台的差异。freeCodeCamp 控制台应该打印两次变量,分别对应这个挑战的每一个测试。浏览器控制台应该只打印一次变量,因为你清除了第一次的打印结果。", + "ejm0ql": "关闭视频窗口的第三个选项卡,并合并", + "iwch6t": "完成下面的方法,其余的执行类似", + "hihhyz": "完成 return 语句", + "sdxti5": "计数 target 的子节点,并删掉", + "wfw6sc": "创建 x 和 y 轴", + "sjw6f4": "在这里创建轴", + "nupsh2": "创建一个二维数组,有 m 行 n 列,元素均为 0", + "xfjb3s": "在这行下面声明 myGlobal 变量", + "htpjk7": "为 decrement action types 定义一个常量", + "tfzdsp": "为 increment action types 定义一个常量", + "zh20mi": "定义 ADD、addMessage()、messageReducer() 并在这里存储:", + "43qs4c": "为自减运算定义一个动作创建器", + "nen3qo": "为自增运算定义一个动作创建器", + "0cwyam": "在这里定义一个动作创建器:", + "fq0wsg": "在这里定义一个动作", + "tegkqa": "在这里定义 Container 组件:", + "b5oihn": "定义 counter reducer,根据接收到的动作递增或递减 state", + "91y4pd": "在这里定义 Redux store,传入 reducers", + "eie1vk": "在这里定义 root reducer", + "5s7nnl": "在这里定义 store here:", + "34qe2q": "字典将包含集合的元素", + "2c1wra": "在这里发送接收到的 data action", + "923cpg": "在这里发送 request action", + "picsyf": "在这里发送 action:", + "ysjr1s": "显示代码", + "kjd1am": "这里不能修改 state,否则测试不能通过", + "5tx4ow": "娱乐网站", + "9yu58b": "示例库存清单", + "ciddtb": "找到目标值及其父级", + "ixx548": "修改下方代码,使其结果为 true", + "6mbhjj": "例如:Redux.createStore()", + "jshtzq": "函数返回表示“一杯红茶(black tea)”的字符串", + "cw1ghf": "函数返回表示“一杯绿茶(green tea)”的字符串", + "iuccln": "返回一个随机填充的数组", + "bm2mop": "点击之后获取 tabs", + "kchz5k": "点击之前获取 tabs", + "bfd23c": "有一个函数(代表茶的种类)和需要几杯茶,下面的函数返回一个数组,包含字符串(每个字符串表示一杯特别种类的茶)。", + "ead98i": "全局 count 变量:", + "7zf0i2": "将它们合并起来", + "5j2l88": "我们创建三个浏览器窗口", + "e843r9": "我们现在打开一个新的选项卡", + "5fvehh": "在 myLocalScope 之外,未定义 myVar", + "qn720a": "现在,在 console.log() 之前添加 console.clear(),清除浏览器控制台的内容,通过测试。", + "j86mef": "现在执行打开选项卡,关闭选项卡和其他操作", + "mk7rvy": "现在移除 console log 这一行,通过测试", + "n7vm1s": "只修改这一行上面的代码", + "cvh4x7": "只修改这一行下面的代码", + "lvmnm7": "打开一个新的选项卡,显示猫的图片", + "avpx79": "打开你的浏览器控制台。", + "0b5ps6": "画布边线和图表之间的 padding", + "uemoej": "将 n 个 0 推入当前行以创建列", + "lm86nf": "将当前行(已有 n 个 0)推送到数组", + "qscelx": "可从 Redux 对象获得 Redux 方法", + "atqiig": "在这一行下面渲染一个输入框(input),按钮(button)和列表(ul)", + "yq81wg": "在这一行下面渲染 Provider", + "kxio9j": "responseFromServer 设置为 false,表示从服务器获得无效响应", + "alh6pw": "responseFromServer 设置为 true,表示从服务器获得有效响应", + "1cfidd": "responseFromServer 表示从服务器获得一个响应", + "96tntk": "返回 30", + "58a5g7": "运行并检查控制台", + "71bus9": "运行测试,查看两个控制台的差异。", + "7wp46n": "设置为华氏刻度", + "oefvg5": "设置", + "mnt4d3": "应该显示 'carrot'", + "fhe9m4": "社交网站", + "za434b": "每周训练的堆积条形图", + "7c1fv9": "堆积条形图在这里显示", + "r44ovx": "tabs 是在窗口中打开的每个站点的 title 的数组", + "cl8peb": "测试数组:", + "1xi3cv": "全局变量", + "3gc01a": "main.scss 文件", + "14kfog": "这是交集方法", + "d1shtt": "这是并集方法", + "pqq6sy": "此方法添加一个元素到集合中", + "nd2oxy": "此方法将检查元素是否存在,并返回 true 或 false", + "ocm81t": "此方法将从集合中删除一个元素", + "or9p5p": "此方法将返回集合中的所有值", + "g1608f": "此方法将返回集合的大小", + "bheu99": "这将保存一个集合", + "x1djjr": "在下一行使用 console.clear(),清除浏览器控制台的内容", + "22ta95": "使用 console.log() 打印输出变量", + "w43c7l": "使用 s = [2, 5, 7] 将无效", + "pgckoj": "变量赋值", + "2xiqvv": "变量声明", + "2sx8zg": "我们记录对象内部的数组", + "xmjfd8": "当你关闭一个选项卡时", + "es69h6": "当你将两个窗口合并为一个窗口时", + "fho5t5": "当你在最后打开一个选项卡时", + "00kcrm": "输出 true", + "sxpg2a": "你的邮箱、Google Drive 和其他工作地点" +} diff --git a/curriculum/dictionaries/english/comments-to-not-translate.js b/curriculum/dictionaries/english/comments-to-not-translate.js deleted file mode 100644 index 295eb22749..0000000000 --- a/curriculum/dictionaries/english/comments-to-not-translate.js +++ /dev/null @@ -1,51 +0,0 @@ -/* eslint-disable max-len */ -// NOTE: updates to translations will not appear until the client is restarted -// i.e. close it and run npm run develop - -const COMMENTS_TO_NOT_TRANSLATE = [ - { - id: 'rms15q', - text: 'React-Redux:' - }, - { - id: '78gz3i', - text: 'React:' - }, - { - id: '7e3lpb', - text: 'Redux:' - }, - { - id: 'b0atz9', - text: `

Hello World

- -

CatPhotoApp

- -

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

` - }, - { - id: 'b1x7w0', - text: `import React from 'react' -import ReactDOM from 'react-dom' -import { Provider, connect } from 'react-redux' -import { createStore, combineReducers, applyMiddleware } from 'redux' -import thunk from 'redux-thunk' - -import rootReducer from './redux/reducers' -import App from './components/App' - -const store = createStore( - rootReducer, - applyMiddleware(thunk) -); - -ReactDOM.render( - - - , - document.getElementById('root') -);` - } -]; - -exports.COMMENTS_TO_NOT_TRANSLATE = COMMENTS_TO_NOT_TRANSLATE; diff --git a/curriculum/dictionaries/english/comments-to-not-translate.json b/curriculum/dictionaries/english/comments-to-not-translate.json new file mode 100644 index 0000000000..15068055e1 --- /dev/null +++ b/curriculum/dictionaries/english/comments-to-not-translate.json @@ -0,0 +1,7 @@ +{ + "rms15q": "React-Redux:", + "78gz3i": "React:", + "7e3lpb": "Redux:", + "b0atz9": "

Hello World

\n\n

CatPhotoApp

\n\n

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

", + "b1x7w0": "import React from 'react'\nimport ReactDOM from 'react-dom'\nimport { Provider, connect } from 'react-redux'\nimport { createStore, combineReducers, applyMiddleware } from 'redux'\nimport thunk from 'redux-thunk'\n\nimport rootReducer from './redux/reducers'\nimport App from './components/App'\n\nconst store = createStore(\n rootReducer,\n applyMiddleware(thunk)\n);\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);" +} diff --git a/curriculum/dictionaries/english/comments.json b/curriculum/dictionaries/english/comments.json index 9efed15076..4330bb636c 100644 --- a/curriculum/dictionaries/english/comments.json +++ b/curriculum/dictionaries/english/comments.json @@ -1,434 +1,110 @@ -[ - { - "id": "hyek8f", - "text": "24.44 in Celsius" - }, - { - "id": "rscjup", - "text": "26 in Celsius" - }, - { - "id": "am2xch", - "text": "A list of strings representing tasks to do:" - }, - { - "id": "6rztdg", - "text": "Add a record here" - }, - { - "id": "to1vwe", - "text": "Add handleChange() and submitMessage() methods here" - }, - { - "id": "31b7ey", - "text": "Add your code above this line" - }, - { - "id": "c24by8", - "text": "Add your code below this line" - }, - { - "id": "jbrt8k", - "text": "Adds the m-th row into newArray" - }, - { - "id": "zkh12d", - "text": "After passing the challenge experiment with myString and see how the grouping works" - }, - { - "id": "mobihi", - "text": "Assign 5 to oopsGlobal Here" - }, - { - "id": "v3ups9", - "text": "Call scale with an argument here" - }, - { - "id": "iw4a3a", - "text": "Case 1: Target has no children" - }, - { - "id": "463xp8", - "text": "Case 2: Target has one child" - }, - { - "id": "u3inrm", - "text": "Case 3: Target has two children" - }, - { - "id": "axnbgg", - "text": "Change code above this line" - }, - { - "id": "i2kck7", - "text": "Change code below this line" - }, - { - "id": "dlbobn", - "text": "Change this line" - }, - { - "id": "v127zb", - "text": "Check the two consoles to see the difference. The freeCodeCamp console should have printed the variable twice, once for each test of this challenge. The browser console should only print the variable once because you cleared it first." - }, - { - "id": "ejm0ql", - "text": "Close third tab in video window, and join" - }, - { - "id": "iwch6t", - "text": "Complete the method below and implement the others similarly" - }, - { - "id": "hihhyz", - "text": "Complete the return statement:" - }, - { - "id": "sdxti5", - "text": "Count the children of the target to delete" - }, - { - "id": "wfw6sc", - "text": "Create an x and y scale" - }, - { - "id": "sjw6f4", - "text": "Create the scale here" - }, - { - "id": "nupsh2", - "text": "Creates a 2-D array with m rows and n columns of zeroes" - }, - { - "id": "xfjb3s", - "text": "Declare the myGlobal variable below this line" - }, - { - "id": "htpjk7", - "text": "Define a constant for decrement action types" - }, - { - "id": "tfzdsp", - "text": "Define a constant for increment action types" - }, - { - "id": "zh20mi", - "text": "Define ADD, addMessage(), messageReducer(), and store here:" - }, - { - "id": "43qs4c", - "text": "Define an action creator for decrementing" - }, - { - "id": "nen3qo", - "text": "Define an action creator for incrementing" - }, - { - "id": "0cwyam", - "text": "Define an action creator here:" - }, - { - "id": "fq0wsg", - "text": "Define an action here:" - }, - { - "id": "tegkqa", - "text": "Define the Container component here:" - }, - { - "id": "b5oihn", - "text": "Define the counter reducer which will increment or decrement the state based on the action it receives" - }, - { - "id": "91y4pd", - "text": "Define the Redux store here, passing in your reducers" - }, - { - "id": "eie1vk", - "text": "Define the root reducer here" - }, - { - "id": "5s7nnl", - "text": "Define the store here:" - }, - { - "id": "34qe2q", - "text": "Dictionary will hold the items of our set" - }, - { - "id": "2c1wra", - "text": "Dispatch received data action here" - }, - { - "id": "923cpg", - "text": "Dispatch request action here" - }, - { - "id": "picsyf", - "text": "Dispatch the action here:" - }, - { - "id": "ysjr1s", - "text": "Display code" - }, - { - "id": "kjd1am", - "text": "Don't mutate state here or the tests will fail" - }, - { - "id": "5tx4ow", - "text": "Entertainment sites" - }, - { - "id": "9yu58b", - "text": "Example inventory lists" - }, - { - "id": "ciddtb", - "text": "Find the target value and its parent" - }, - { - "id": "ixx548", - "text": "Fix the code below so that it evaluates to true" - }, - { - "id": "6mbhjj", - "text": "For example: Redux.createStore()" - }, - { - "id": "jshtzq", - "text": "Function that returns a string representing a cup of black tea" - }, - { - "id": "cw1ghf", - "text": "Function that returns a string representing a cup of green tea" - }, - { - "id": "iuccln", - "text": "Generate a randomly filled array" - }, - { - "id": "bm2mop", - "text": "Get the tabs after the tab" - }, - { - "id": "kchz5k", - "text": "Get the tabs before the tab" - }, - { - "id": "bfd23c", - "text": "Given a function (representing the tea type) and number of cups needed, the\nfollowing function returns an array of strings (each representing a cup of\na specific type of tea)." - }, - { - "id": "ead98i", - "text": "Global count variable:" - }, - { - "id": "7zf0i2", - "text": "Join them together" - }, - { - "id": "5j2l88", - "text": "Let's create three browser windows" - }, - { - "id": "e843r9", - "text": "Let's open a new tab for now" - }, - { - "id": "5fvehh", - "text": "myVar is not defined outside of myLocalScope" - }, - { - "id": "qn720a", - "text": "Now, add console.clear() before your console.log() to clear the browser console, and pass the tests." - }, - { - "id": "j86mef", - "text": "Now perform the tab opening, closing, and other operations" - }, - { - "id": "mk7rvy", - "text": "Now remove the console log line to pass the test" - }, - { - "id": "n7vm1s", - "text": "Only change code above this line" - }, - { - "id": "cvh4x7", - "text": "Only change code below this line" - }, - { - "id": "lvmnm7", - "text": "Open a new tab for cat memes" - }, - { - "id": "avpx79", - "text": "Open your browser console." - }, - { - "id": "0b5ps6", - "text": "Padding between the SVG canvas boundary and the plot" - }, - { - "id": "uemoej", - "text": "Pushes n zeroes into the current row to create the columns" - }, - { - "id": "lm86nf", - "text": "Pushes the current row, which now has n zeroes in it, to the array" - }, - { - "id": "qscelx", - "text": "Redux methods are available from a Redux object" - }, - { - "id": "atqiig", - "text": "Render an input, button, and ul below this line" - }, - { - "id": "yq81wg", - "text": "Render the Provider below this line" - }, - { - "id": "kxio9j", - "text": "responseFromServer is set to false to represent an unsuccessful response from a server" - }, - { - "id": "alh6pw", - "text": "responseFromServer is set to true to represent a successful response from a server" - }, - { - "id": "1cfidd", - "text": "responseFromServer represents a response from a server" - }, - { - "id": "96tntk", - "text": "Returns 30" - }, - { - "id": "58a5g7", - "text": "Run and check the console" - }, - { - "id": "71bus9", - "text": "Run the tests to see the difference between the two consoles." - }, - { - "id": "7wp46n", - "text": "Setting in Fahrenheit scale" - }, - { - "id": "oefvg5", - "text": "Setup" - }, - { - "id": "mnt4d3", - "text": "Should display 'carrot'" - }, - { - "id": "fhe9m4", - "text": "Social sites" - }, - { - "id": "za434b", - "text": "Stacked bar chart of weekly training" - }, - { - "id": "7c1fv9", - "text": "Stacked bar chart will go here" - }, - { - "id": "r44ovx", - "text": "tabs is an array of titles of each site open within the window" - }, - { - "id": "cl8peb", - "text": "test array:" - }, - { - "id": "1xi3cv", - "text": "The global variable" - }, - { - "id": "3gc01a", - "text": "The main.scss file" - }, - { - "id": "14kfog", - "text": "This is our intersection method" - }, - { - "id": "d1shtt", - "text": "This is our union method" - }, - { - "id": "pqq6sy", - "text": "This method will add an element to the set" - }, - { - "id": "nd2oxy", - "text": "This method will check for the presence of an element and return true or false" - }, - { - "id": "ocm81t", - "text": "This method will remove an element from a set" - }, - { - "id": "or9p5p", - "text": "This method will return all the values in the set" - }, - { - "id": "g1608f", - "text": "This method will return the size of the set" - }, - { - "id": "bheu99", - "text": "This will hold the set" - }, - { - "id": "x1djjr", - "text": "Use console.clear() on the next line to clear the browser console." - }, - { - "id": "22ta95", - "text": "Use console.log() to print the output variable." - }, - { - "id": "w43c7l", - "text": "Using s = [2, 5, 7] would be invalid" - }, - { - "id": "pgckoj", - "text": "Variable assignments" - }, - { - "id": "2xiqvv", - "text": "Variable declarations" - }, - { - "id": "2sx8zg", - "text": "We keep a record of the array inside the object" - }, - { - "id": "xmjfd8", - "text": "When you close a tab" - }, - { - "id": "es69h6", - "text": "When you join two windows into one window" - }, - { - "id": "fho5t5", - "text": "When you open a new tab at the end" - }, - { - "id": "00kcrm", - "text": "yields true" - }, - { - "id": "sxpg2a", - "text": "Your mailbox, drive, and other work sites" - } -] \ No newline at end of file +{ + "hyek8f": "24.44 in Celsius", + "rscjup": "26 in Celsius", + "am2xch": "A list of strings representing tasks to do:", + "6rztdg": "Add a record here", + "to1vwe": "Add handleChange() and submitMessage() methods here", + "31b7ey": "Add your code above this line", + "c24by8": "Add your code below this line", + "jbrt8k": "Adds the m-th row into newArray", + "zkh12d": "After passing the challenge experiment with myString and see how the grouping works", + "mobihi": "Assign 5 to oopsGlobal Here", + "v3ups9": "Call scale with an argument here", + "iw4a3a": "Case 1: Target has no children", + "463xp8": "Case 2: Target has one child", + "u3inrm": "Case 3: Target has two children", + "axnbgg": "Change code above this line", + "i2kck7": "Change code below this line", + "dlbobn": "Change this line", + "v127zb": "Check the two consoles to see the difference. The freeCodeCamp console should have printed the variable twice, once for each test of this challenge. The browser console should only print the variable once because you cleared it first.", + "ejm0ql": "Close third tab in video window, and join", + "iwch6t": "Complete the method below and implement the others similarly", + "hihhyz": "Complete the return statement:", + "sdxti5": "Count the children of the target to delete", + "wfw6sc": "Create an x and y scale", + "sjw6f4": "Create the scale here", + "nupsh2": "Creates a 2-D array with m rows and n columns of zeroes", + "xfjb3s": "Declare the myGlobal variable below this line", + "htpjk7": "Define a constant for decrement action types", + "tfzdsp": "Define a constant for increment action types", + "zh20mi": "Define ADD, addMessage(), messageReducer(), and store here:", + "43qs4c": "Define an action creator for decrementing", + "nen3qo": "Define an action creator for incrementing", + "0cwyam": "Define an action creator here:", + "fq0wsg": "Define an action here:", + "tegkqa": "Define the Container component here:", + "b5oihn": "Define the counter reducer which will increment or decrement the state based on the action it receives", + "91y4pd": "Define the Redux store here, passing in your reducers", + "eie1vk": "Define the root reducer here", + "5s7nnl": "Define the store here:", + "34qe2q": "Dictionary will hold the items of our set", + "2c1wra": "Dispatch received data action here", + "923cpg": "Dispatch request action here", + "picsyf": "Dispatch the action here:", + "ysjr1s": "Display code", + "kjd1am": "Don't mutate state here or the tests will fail", + "5tx4ow": "Entertainment sites", + "9yu58b": "Example inventory lists", + "ciddtb": "Find the target value and its parent", + "ixx548": "Fix the code below so that it evaluates to true", + "6mbhjj": "For example: Redux.createStore()", + "jshtzq": "Function that returns a string representing a cup of black tea", + "cw1ghf": "Function that returns a string representing a cup of green tea", + "iuccln": "Generate a randomly filled array", + "bm2mop": "Get the tabs after the tab", + "kchz5k": "Get the tabs before the tab", + "bfd23c": "Given a function (representing the tea type) and number of cups needed, the\nfollowing function returns an array of strings (each representing a cup of\na specific type of tea).", + "ead98i": "Global count variable:", + "7zf0i2": "Join them together", + "5j2l88": "Let's create three browser windows", + "e843r9": "Let's open a new tab for now", + "5fvehh": "myVar is not defined outside of myLocalScope", + "qn720a": "Now, add console.clear() before your console.log() to clear the browser console, and pass the tests.", + "j86mef": "Now perform the tab opening, closing, and other operations", + "mk7rvy": "Now remove the console log line to pass the test", + "n7vm1s": "Only change code above this line", + "cvh4x7": "Only change code below this line", + "lvmnm7": "Open a new tab for cat memes", + "avpx79": "Open your browser console.", + "0b5ps6": "Padding between the SVG canvas boundary and the plot", + "uemoej": "Pushes n zeroes into the current row to create the columns", + "lm86nf": "Pushes the current row, which now has n zeroes in it, to the array", + "qscelx": "Redux methods are available from a Redux object", + "atqiig": "Render an input, button, and ul below this line", + "yq81wg": "Render the Provider below this line", + "kxio9j": "responseFromServer is set to false to represent an unsuccessful response from a server", + "alh6pw": "responseFromServer is set to true to represent a successful response from a server", + "1cfidd": "responseFromServer represents a response from a server", + "96tntk": "Returns 30", + "58a5g7": "Run and check the console", + "71bus9": "Run the tests to see the difference between the two consoles.", + "7wp46n": "Setting in Fahrenheit scale", + "oefvg5": "Setup", + "mnt4d3": "Should display 'carrot'", + "fhe9m4": "Social sites", + "za434b": "Stacked bar chart of weekly training", + "7c1fv9": "Stacked bar chart will go here", + "r44ovx": "tabs is an array of titles of each site open within the window", + "cl8peb": "test array:", + "1xi3cv": "The global variable", + "3gc01a": "The main.scss file", + "14kfog": "This is our intersection method", + "d1shtt": "This is our union method", + "pqq6sy": "This method will add an element to the set", + "nd2oxy": "This method will check for the presence of an element and return true or false", + "ocm81t": "This method will remove an element from a set", + "or9p5p": "This method will return all the values in the set", + "g1608f": "This method will return the size of the set", + "bheu99": "This will hold the set", + "x1djjr": "Use console.clear() on the next line to clear the browser console.", + "22ta95": "Use console.log() to print the output variable.", + "w43c7l": "Using s = [2, 5, 7] would be invalid", + "pgckoj": "Variable assignments", + "2xiqvv": "Variable declarations", + "2sx8zg": "We keep a record of the array inside the object", + "xmjfd8": "When you close a tab", + "es69h6": "When you join two windows into one window", + "fho5t5": "When you open a new tab at the end", + "00kcrm": "yields true", + "sxpg2a": "Your mailbox, drive, and other work sites" +} diff --git a/curriculum/dictionaries/espanol/comments.json b/curriculum/dictionaries/espanol/comments.json index 6a05dca186..db49c71fed 100644 --- a/curriculum/dictionaries/espanol/comments.json +++ b/curriculum/dictionaries/espanol/comments.json @@ -1,434 +1,110 @@ -[ - { - "id": "hyek8f", - "text": "24.44 en Celsius" - }, - { - "id": "rscjup", - "text": "26 en Celsius" - }, - { - "id": "am2xch", - "text": "Una lista de cadenas de texto representando tareas por hacer:" - }, - { - "id": "6rztdg", - "text": "Agrega un registro aquí" - }, - { - "id": "to1vwe", - "text": "Agrega los métodos handleChange() y submitMessage() aquí" - }, - { - "id": "31b7ey", - "text": "Agrega tu código encima de esta línea" - }, - { - "id": "c24by8", - "text": "Agrega tu código debajo de esta línea" - }, - { - "id": "jbrt8k", - "text": "Agrega la fila número m a newArray" - }, - { - "id": "zkh12d", - "text": "Después de pasar el desafío experimenta con myString y observa cómo funciona la agrupación" - }, - { - "id": "mobihi", - "text": "Asigna 5 a oopsGlobal aquí" - }, - { - "id": "v3ups9", - "text": "Llama scale con un argumento aquí" - }, - { - "id": "iw4a3a", - "text": "Caso 1: El objetivo no tiene hijo" - }, - { - "id": "463xp8", - "text": "Caso 2: El objetivo tiene un hijo" - }, - { - "id": "u3inrm", - "text": "caso 3: El objetivo tiene dos hijos" - }, - { - "id": "axnbgg", - "text": "Cambia el código encima de esta línea" - }, - { - "id": "i2kck7", - "text": "Cambia el código debajo de esta línea" - }, - { - "id": "dlbobn", - "text": "Cambia esta línea" - }, - { - "id": "v127zb", - "text": "Verifica las dos consolas para ver la diferencia. La consola de freeCodeCamp debería haber impreso la variable dos veces, una por cada prueba de este desafío. La consola del navegador solo debería imprimir la variable una vez dado que la limpiaste primero." - }, - { - "id": "ejm0ql", - "text": "Cierra la tercera pestaña en videoWindow y une" - }, - { - "id": "iwch6t", - "text": "Completa el método de abajo e implementa los otros de manera similar" - }, - { - "id": "hihhyz", - "text": "Completa la sentencia return:" - }, - { - "id": "sdxti5", - "text": "Cuenta los hijos del objetivo a eliminar" - }, - { - "id": "wfw6sc", - "text": "Crea una escala de X y Y" - }, - { - "id": "sjw6f4", - "text": "Crea la escala aquí" - }, - { - "id": "nupsh2", - "text": "Crea un arreglo de 2 dimensiones con m filas y n columnas de ceros" - }, - { - "id": "xfjb3s", - "text": "Declara la variable myGlobal debajo de esta línea" - }, - { - "id": "htpjk7", - "text": "Define una constante para acciones de decremento" - }, - { - "id": "tfzdsp", - "text": "Define una constante para acciones de incremento" - }, - { - "id": "zh20mi", - "text": "Define ADD, addMessage(), messageReducer(), y store aquí:" - }, - { - "id": "43qs4c", - "text": "Define un creador de acción para decrementar" - }, - { - "id": "nen3qo", - "text": "Define un creador de acción para incrementar" - }, - { - "id": "0cwyam", - "text": "Define un creador de acción aquí:" - }, - { - "id": "fq0wsg", - "text": "Define una acción aquí:" - }, - { - "id": "tegkqa", - "text": "Define el componente Container aquí:" - }, - { - "id": "b5oihn", - "text": "Define el reductor counter que aumentará o disminuirá el estado en función de la acción que reciba" - }, - { - "id": "91y4pd", - "text": "Define el store de Redux aquí, pasando tus reductores" - }, - { - "id": "eie1vk", - "text": "Define el reductor root aquí" - }, - { - "id": "5s7nnl", - "text": "Define el store aquí:" - }, - { - "id": "34qe2q", - "text": "El diccionario almacenará elementos de nuestro conjunto" - }, - { - "id": "2c1wra", - "text": "Despacha la acción received data aquí" - }, - { - "id": "923cpg", - "text": "Despacha la acción request aquí" - }, - { - "id": "picsyf", - "text": "Despacha la acción aquí:" - }, - { - "id": "ysjr1s", - "text": "Muestra el código" - }, - { - "id": "kjd1am", - "text": "No mutes el estado aquí o la prueba fallará" - }, - { - "id": "5tx4ow", - "text": "Sitios de entretenimiento" - }, - { - "id": "9yu58b", - "text": "Ejemplo listas de inventario" - }, - { - "id": "ciddtb", - "text": "Encuentra el valor del objetivo y su padre" - }, - { - "id": "ixx548", - "text": "Arregla el código de abajo para que evalúe a true" - }, - { - "id": "6mbhjj", - "text": "Por ejemplo: Redux.createStore()" - }, - { - "id": "jshtzq", - "text": "Función que retorna una cadena de texto representando una taza de té negro" - }, - { - "id": "cw1ghf", - "text": "Función que retorna una cadena de texto representando una taza de té verde" - }, - { - "id": "iuccln", - "text": "Genera un arreglo lleno al azar" - }, - { - "id": "bm2mop", - "text": "Obtiene las pestañas después de la pestaña" - }, - { - "id": "kchz5k", - "text": "Obtiene las pestañas antes de la pestaña" - }, - { - "id": "bfd23c", - "text": "Dada una función (representando el tipo de té) y el número de tazas necesarias, la \n siguiente función retorna un arreglo de cadenas de texto (cada una representando un tipo específico de té)." - }, - { - "id": "ead98i", - "text": "Variable global count:" - }, - { - "id": "7zf0i2", - "text": "Únelos juntos" - }, - { - "id": "5j2l88", - "text": "Vamos a crear tres ventanas del navegador" - }, - { - "id": "e843r9", - "text": "Abramos una nueva pestaña por ahora" - }, - { - "id": "5fvehh", - "text": "myVar no está definida afuera de myLocalScope" - }, - { - "id": "qn720a", - "text": "Ahora, agrega console.clear() antes de tu console.log() para limpiar la consola del navegador y pasar la prueba" - }, - { - "id": "j86mef", - "text": "Ahora completa la apertura de la pestaña, cierre, y otras operaciones" - }, - { - "id": "mk7rvy", - "text": "Ahora remueve la línea del console log para pasar la prueba" - }, - { - "id": "n7vm1s", - "text": "Cambia solo el código encima de esta línea" - }, - { - "id": "cvh4x7", - "text": "Cambia solo el código debajo de esta línea" - }, - { - "id": "lvmnm7", - "text": "Abre una nueva pestaña para memes de gatos" - }, - { - "id": "avpx79", - "text": "Abre la consola de tu navegador." - }, - { - "id": "0b5ps6", - "text": "Relleno entre el límite del canvas SVG y el gráfico" - }, - { - "id": "uemoej", - "text": "Inserta n ceros a la fila actual para crear las columnas" - }, - { - "id": "lm86nf", - "text": "Inserta la fila actual, que ahora contiene n ceros, al arreglo" - }, - { - "id": "qscelx", - "text": "Los métodos Redux están disponibles desde un objeto Redux" - }, - { - "id": "atqiig", - "text": "Renderiza un input, button, y ul debajo de esta línea" - }, - { - "id": "yq81wg", - "text": "Renderiza el Provider debajo de esta línea" - }, - { - "id": "kxio9j", - "text": "responseFromServer es establecido a false para representar una respuesta no satisfactoria del servidor" - }, - { - "id": "alh6pw", - "text": "responseFromServer es establecido a true para representar una respuesta satisfactoria del servidor" - }, - { - "id": "1cfidd", - "text": "responseFromServer representa una respuesta de un servidor" - }, - { - "id": "96tntk", - "text": "Retorna 30" - }, - { - "id": "58a5g7", - "text": "Ejecuta y verifica la consola" - }, - { - "id": "71bus9", - "text": "Ejecuta las pruebas para ver la diferencia entre las dos consolas." - }, - { - "id": "7wp46n", - "text": "Ajuste en escala Farenheit" - }, - { - "id": "oefvg5", - "text": "Configuración" - }, - { - "id": "mnt4d3", - "text": "Debería mostrar 'carrot'" - }, - { - "id": "fhe9m4", - "text": "Sitios sociales" - }, - { - "id": "za434b", - "text": "La tabla de barras apiladas de entrenamiento semanal" - }, - { - "id": "7c1fv9", - "text": "La tabla de barras apiladas irá aquí" - }, - { - "id": "r44ovx", - "text": "tabs es un arreglo de títulos de cada sítio abierto dentro de la ventana" - }, - { - "id": "cl8peb", - "text": "arreglo de prueba:" - }, - { - "id": "1xi3cv", - "text": "La variable global" - }, - { - "id": "3gc01a", - "text": "El archivo main.scss" - }, - { - "id": "14kfog", - "text": "Este es nuestro método de intersección" - }, - { - "id": "d1shtt", - "text": "Este es nuestro método de unión" - }, - { - "id": "pqq6sy", - "text": "Este método agregará un elemento al conjunto" - }, - { - "id": "nd2oxy", - "text": "Este método verificará la existencia de un elemento y retornará true o false" - }, - { - "id": "ocm81t", - "text": "Este método removerá un elemento del conjunto" - }, - { - "id": "or9p5p", - "text": "Este método retornará todos los valores del conjunto" - }, - { - "id": "g1608f", - "text": "Este método retornará el tamaño del conjunto" - }, - { - "id": "bheu99", - "text": "Esto almacenará el conjunto" - }, - { - "id": "x1djjr", - "text": "Usa console.clear() en la siguiente línea para limpiar la consola del navegador." - }, - { - "id": "22ta95", - "text": "Usa console.log() para imprimir la variable output." - }, - { - "id": "w43c7l", - "text": "Usar s = [2, 5, 7] sería inválido" - }, - { - "id": "pgckoj", - "text": "Asignación de variables" - }, - { - "id": "2xiqvv", - "text": "Declaración de variables" - }, - { - "id": "2sx8zg", - "text": "Mantenemos un registro del arreglo dentro del objeto" - }, - { - "id": "xmjfd8", - "text": "Cuando cierras una pestaña" - }, - { - "id": "es69h6", - "text": "Cuando unes dos ventanas en una" - }, - { - "id": "fho5t5", - "text": "Cuando abres una nueva pestaña al final" - }, - { - "id": "00kcrm", - "text": "produce true" - }, - { - "id": "sxpg2a", - "text": "Tu casilla de correo, drive y otros sitios de trabajo" - } -] +{ + "hyek8f": "24.44 en Celsius", + "rscjup": "26 en Celsius", + "am2xch": "Una lista de cadenas de texto representando tareas por hacer:", + "6rztdg": "Agrega un registro aquí", + "to1vwe": "Agrega los métodos handleChange() y submitMessage() aquí", + "31b7ey": "Agrega tu código encima de esta línea", + "c24by8": "Agrega tu código debajo de esta línea", + "jbrt8k": "Agrega la fila número m a newArray", + "zkh12d": "Después de pasar el desafío experimenta con myString y observa cómo funciona la agrupación", + "mobihi": "Asigna 5 a oopsGlobal aquí", + "v3ups9": "Llama scale con un argumento aquí", + "iw4a3a": "Caso 1: El objetivo no tiene hijo", + "463xp8": "Caso 2: El objetivo tiene un hijo", + "u3inrm": "caso 3: El objetivo tiene dos hijos", + "axnbgg": "Cambia el código encima de esta línea", + "i2kck7": "Cambia el código debajo de esta línea", + "dlbobn": "Cambia esta línea", + "v127zb": "Verifica las dos consolas para ver la diferencia. La consola de freeCodeCamp debería haber impreso la variable dos veces, una por cada prueba de este desafío. La consola del navegador solo debería imprimir la variable una vez dado que la limpiaste primero.", + "ejm0ql": "Cierra la tercera pestaña en videoWindow y une", + "iwch6t": "Completa el método de abajo e implementa los otros de manera similar", + "hihhyz": "Completa la sentencia return:", + "sdxti5": "Cuenta los hijos del objetivo a eliminar", + "wfw6sc": "Crea una escala de X y Y", + "sjw6f4": "Crea la escala aquí", + "nupsh2": "Crea un arreglo de 2 dimensiones con m filas y n columnas de ceros", + "xfjb3s": "Declara la variable myGlobal debajo de esta línea", + "htpjk7": "Define una constante para acciones de decremento", + "tfzdsp": "Define una constante para acciones de incremento", + "zh20mi": "Define ADD, addMessage(), messageReducer(), y store aquí:", + "43qs4c": "Define un creador de acción para decrementar", + "nen3qo": "Define un creador de acción para incrementar", + "0cwyam": "Define un creador de acción aquí:", + "fq0wsg": "Define una acción aquí:", + "tegkqa": "Define el componente Container aquí:", + "b5oihn": "Define el reductor counter que aumentará o disminuirá el estado en función de la acción que reciba", + "91y4pd": "Define el store de Redux aquí, pasando tus reductores", + "eie1vk": "Define el reductor root aquí", + "5s7nnl": "Define el store aquí:", + "34qe2q": "El diccionario almacenará elementos de nuestro conjunto", + "2c1wra": "Despacha la acción received data aquí", + "923cpg": "Despacha la acción request aquí", + "picsyf": "Despacha la acción aquí:", + "ysjr1s": "Muestra el código", + "kjd1am": "No mutes el estado aquí o la prueba fallará", + "5tx4ow": "Sitios de entretenimiento", + "9yu58b": "Ejemplo listas de inventario", + "ciddtb": "Encuentra el valor del objetivo y su padre", + "ixx548": "Arregla el código de abajo para que evalúe a true", + "6mbhjj": "Por ejemplo: Redux.createStore()", + "jshtzq": "Función que retorna una cadena de texto representando una taza de té negro", + "cw1ghf": "Función que retorna una cadena de texto representando una taza de té verde", + "iuccln": "Genera un arreglo lleno al azar", + "bm2mop": "Obtiene las pestañas después de la pestaña", + "kchz5k": "Obtiene las pestañas antes de la pestaña", + "bfd23c": "Dada una función (representando el tipo de té) y el número de tazas necesarias, la \n siguiente función retorna un arreglo de cadenas de texto (cada una representando un tipo específico de té).", + "ead98i": "Variable global count:", + "7zf0i2": "Únelos juntos", + "5j2l88": "Vamos a crear tres ventanas del navegador", + "e843r9": "Abramos una nueva pestaña por ahora", + "5fvehh": "myVar no está definida afuera de myLocalScope", + "qn720a": "Ahora, agrega console.clear() antes de tu console.log() para limpiar la consola del navegador y pasar la prueba", + "j86mef": "Ahora completa la apertura de la pestaña, cierre, y otras operaciones", + "mk7rvy": "Ahora remueve la línea del console log para pasar la prueba", + "n7vm1s": "Cambia solo el código encima de esta línea", + "cvh4x7": "Cambia solo el código debajo de esta línea", + "lvmnm7": "Abre una nueva pestaña para memes de gatos", + "avpx79": "Abre la consola de tu navegador.", + "0b5ps6": "Relleno entre el límite del canvas SVG y el gráfico", + "uemoej": "Inserta n ceros a la fila actual para crear las columnas", + "lm86nf": "Inserta la fila actual, que ahora contiene n ceros, al arreglo", + "qscelx": "Los métodos Redux están disponibles desde un objeto Redux", + "atqiig": "Renderiza un input, button, y ul debajo de esta línea", + "yq81wg": "Renderiza el Provider debajo de esta línea", + "kxio9j": "responseFromServer es establecido a false para representar una respuesta no satisfactoria del servidor", + "alh6pw": "responseFromServer es establecido a true para representar una respuesta satisfactoria del servidor", + "1cfidd": "responseFromServer representa una respuesta de un servidor", + "96tntk": "Retorna 30", + "58a5g7": "Ejecuta y verifica la consola", + "71bus9": "Ejecuta las pruebas para ver la diferencia entre las dos consolas.", + "7wp46n": "Ajuste en escala Farenheit", + "oefvg5": "Configuración", + "mnt4d3": "Debería mostrar 'carrot'", + "fhe9m4": "Sitios sociales", + "za434b": "La tabla de barras apiladas de entrenamiento semanal", + "7c1fv9": "La tabla de barras apiladas irá aquí", + "r44ovx": "tabs es un arreglo de títulos de cada sítio abierto dentro de la ventana", + "cl8peb": "arreglo de prueba:", + "1xi3cv": "La variable global", + "3gc01a": "El archivo main.scss", + "14kfog": "Este es nuestro método de intersección", + "d1shtt": "Este es nuestro método de unión", + "pqq6sy": "Este método agregará un elemento al conjunto", + "nd2oxy": "Este método verificará la existencia de un elemento y retornará true o false", + "ocm81t": "Este método removerá un elemento del conjunto", + "or9p5p": "Este método retornará todos los valores del conjunto", + "g1608f": "Este método retornará el tamaño del conjunto", + "bheu99": "Esto almacenará el conjunto", + "x1djjr": "Usa console.clear() en la siguiente línea para limpiar la consola del navegador.", + "22ta95": "Usa console.log() para imprimir la variable output.", + "w43c7l": "Usar s = [2, 5, 7] sería inválido", + "pgckoj": "Asignación de variables", + "2xiqvv": "Declaración de variables", + "2sx8zg": "Mantenemos un registro del arreglo dentro del objeto", + "xmjfd8": "Cuando cierras una pestaña", + "es69h6": "Cuando unes dos ventanas en una", + "fho5t5": "Cuando abres una nueva pestaña al final", + "00kcrm": "produce true", + "sxpg2a": "Tu casilla de correo, drive y otros sitios de trabajo" +} diff --git a/curriculum/getChallenges.js b/curriculum/getChallenges.js index 915d1db05c..d87c47f716 100644 --- a/curriculum/getChallenges.js +++ b/curriculum/getChallenges.js @@ -37,7 +37,7 @@ function getTranslatableComments(dictionariesDir) { 'english', 'comments.json' )); - return COMMENTS_TO_TRANSLATE.map(({ text }) => text); + return Object.values(COMMENTS_TO_TRANSLATE); } exports.getTranslatableComments = getTranslatableComments; @@ -64,15 +64,15 @@ function createCommentMap(dictionariesDir) { 'comments.json' )); - const { COMMENTS_TO_NOT_TRANSLATE } = require(path.resolve( + const COMMENTS_TO_NOT_TRANSLATE = require(path.resolve( dictionariesDir, 'english', 'comments-to-not-translate' )); // map from english comment text to translations - const translatedCommentMap = COMMENTS_TO_TRANSLATE.reduce( - (acc, { id, text }) => { + const translatedCommentMap = Object.entries(COMMENTS_TO_TRANSLATE).reduce( + (acc, [id, text]) => { return { ...acc, [text]: getTranslationEntry(dictionaries, { engId: id, text }) @@ -82,22 +82,21 @@ function createCommentMap(dictionariesDir) { ); // map from english comment text to itself - const untranslatableCommentMap = COMMENTS_TO_NOT_TRANSLATE.reduce( - (acc, { text }) => { - const englishEntry = languages.reduce( - (acc, lang) => ({ - ...acc, - [lang]: text - }), - {} - ); - return { + const untranslatableCommentMap = Object.values( + COMMENTS_TO_NOT_TRANSLATE + ).reduce((acc, text) => { + const englishEntry = languages.reduce( + (acc, lang) => ({ ...acc, - [text]: englishEntry - }; - }, - {} - ); + [lang]: text + }), + {} + ); + return { + ...acc, + [text]: englishEntry + }; + }, {}); return { ...translatedCommentMap, ...untranslatableCommentMap }; } @@ -106,9 +105,9 @@ exports.createCommentMap = createCommentMap; function getTranslationEntry(dicts, { engId, text }) { return Object.keys(dicts).reduce((acc, lang) => { - const entry = dicts[lang].find(({ id }) => engId === id); + const entry = dicts[lang][engId]; if (entry) { - return { ...acc, [lang]: entry.text }; + return { ...acc, [lang]: entry }; } else { throw Error(`Missing translation for comment '${text}' diff --git a/curriculum/getChallenges.test.js b/curriculum/getChallenges.test.js index 1380e55980..a42302d1ab 100644 --- a/curriculum/getChallenges.test.js +++ b/curriculum/getChallenges.test.js @@ -60,10 +60,21 @@ It should be in '__fixtures__', 'dictionaries' ); + const incompleteDictDir = path.resolve( + __dirname, + '__fixtures__', + 'incomplete-dicts' + ); + it('returns an object', () => { expect(typeof createCommentMap(dictionaryDir)).toBe('object'); }); + it('throws if an entry is missing', () => { + expect.assertions(1); + expect(() => createCommentMap(incompleteDictDir)).toThrow(); + }); + it('returns an object with an expected form', () => { expect.assertions(4); const expectedIds = [