From bb798d70c2aa9ccacb287a5fd0c131b9a54fdfc7 Mon Sep 17 00:00:00 2001 From: Brandon Nguyen <112731698+bxngyn@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:43:14 -0400 Subject: [PATCH 1/3] link locale for internationalization --- check50/__main__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check50/__main__.py b/check50/__main__.py index a675d6e..5957f07 100644 --- a/check50/__main__.py +++ b/check50/__main__.py @@ -27,6 +27,8 @@ LOGGER = logging.getLogger("check50") +gettext.install("check50", str(importlib.resources.files("check50").joinpath("locale"))) + lib50.set_local_path(os.environ.get("CHECK50_PATH", "~/.local/share/check50")) From 52cc80e809112f8003fdfcaadc9e4c703c862d22 Mon Sep 17 00:00:00 2001 From: Brandon Nguyen <112731698+bxngyn@users.noreply.github.com> Date: Thu, 7 Aug 2025 10:47:16 -0400 Subject: [PATCH 2/3] vietnamese support --- check50/locale/vi/LC_MESSAGES/check50.mo | Bin 0 -> 9907 bytes check50/locale/vi/LC_MESSAGES/check50.po | 431 +++++++++++++++++++++++ 2 files changed, 431 insertions(+) create mode 100644 check50/locale/vi/LC_MESSAGES/check50.mo create mode 100644 check50/locale/vi/LC_MESSAGES/check50.po diff --git a/check50/locale/vi/LC_MESSAGES/check50.mo b/check50/locale/vi/LC_MESSAGES/check50.mo new file mode 100644 index 0000000000000000000000000000000000000000..110d8bee4f62b1ffb6b1fe90586b0e5570949e4f GIT binary patch literal 9907 zcmc(k`;#2kRmYn+3HCxD4&m*DYeDb|?~GQ86+0`x^m3%i%8{j2aH4WT&rHuuvpwCT ze(Y+?I2E%+xm>PbizG!{iOSk6&cm@HDM~QeDdVb)%D)6+!w;m2qFf9G{{R%_q9DNM zoZH>gv%4nd7mzJ|xBK2c_uO;7=W*}8_O7>n-r>)2{@%pjFTF*c#(!>lo8x?d$M=9e zZ~^=o@O$6^@UOu4fbV|0N;4grG2Hpa`0)7*G9sDEkD?e$! z`{4DCb0g261m6pu0cXIcz`Ma0!CS%q0N(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!?b}a?-k7l#I0#)T#r>vsWac z5$i9hC7(9w%ad`{Ub*Yv(A3Dw*UQ48NRF zMW9V%_&kX!)rxXH?9`_otc2nl-&1Vk<#9xohVG0uUeF}>$G*BXHwX!9@EDFRIX%9& z&=O-+Fa4%lS!HVkgQgT~O|lox5|6J2l}Q*~;+TQ~GP|RGUPkO@q^xec(58Lju}A{Zvav^9 zPGd;}a(g|bL$Jq&EjyA)>+;c~)aN((jntLV;Irfw7Et9HzN8O!@bG05+z>XE@R?`<;@6rGZ|J=v8H3}ennzOa-}-aGJ#Ht88bQYiXH;nZDx-6iW?35 zBs(6{PSwYY^m|-L(Lr*HLvTSUoA?UPjK6TIs%%~+8Ew31FyNDZ!Sf3BOVPQ|qQ$8C z*{LwAx=@9~_OfR}%gQKwuYR{3;Y&Tr=Gv&V7IIWk^py{nVPiI`b7HzwVQ>}2nr@>eZ6=rFUYTAn1D((i2=TD1Ji z%c|&+r}W$y3>QuIbp9&m{SqrkgS{Ray{wYPg!DH4mDuJ4WBVR{VSy<^GaYui*S^ku z6G6A>bff1bX{0vYUg>Z1lt+cFjj~ti?I&mC1_AY^1 z`5CSqwyaJ&IlSuNk@0<6k$12v0Wnd@rny(!DYGYIPl84oPN~SxHn$(om#ze`O|}(} zOR*DQK3=t?R>*Bv)KHRwlxKu}bksssy*sgkR+^rT8g69Z>1TUparmMH;}u=&lJ*bh zW+X^CVbR~N(E_#feC3_g^g_a2Yi#rzt)5R2wUX-|V64 FzX664X6pa| literal 0 HcmV?d00001 diff --git a/check50/locale/vi/LC_MESSAGES/check50.po b/check50/locale/vi/LC_MESSAGES/check50.po new file mode 100644 index 0000000..f031927 --- /dev/null +++ b/check50/locale/vi/LC_MESSAGES/check50.po @@ -0,0 +1,431 @@ +# Vietnamese translations for check50. +# Copyright (C) 2025 ORGANIZATION +# This file is distributed under the same license as the check50 project. +# FIRST AUTHOR , 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: check50 4.0.0.dev0\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2025-08-05 15:34-0400\n" +"PO-Revision-Date: 2025-08-05 15:34-0400\n" +"Last-Translator: FULL NAME \n" +"Language: vi\n" +"Language-Team: vi \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.17.0\n" + +#: check50/__init__.py:32 +msgid "" +"check50 is not intended for use in interactive mode. Some behavior may " +"not function as expected." +msgstr "" +"check50 không thể sử dụng bằng chế độ tương tác, có thể " +"không hoạt động như mong đợi." + + +#: check50/__main__.py:82 +msgid "failed to install dependencies" +msgstr "không cài đặt dependencies được" + +#: check50/__main__.py:158 +#, python-brace-format +msgid "" +"check50 is taking longer than normal!\n" +"See https://submit.cs50.io/check50/{} for more detail" +msgstr "" +"check50 đang chạy lâu hơn bình thường.\n" +"Xem https://submit.cs50.io/check50/{} để biết thêm thông tin" + +#: check50/__main__.py:164 +msgid "" +"Sorry, something's wrong, please try again.\n" +"If the problem persists, please visit our status page " +"https://cs50.statuspage.io for more information." +msgstr "" +"Rất tiếc, có gì xảy ra, vui lòng thử lại. Nếu vấn đề này còn tiếp nữa, " +"vui lòng xem https://cs50.statuspage.io để biết thêm thông tin." + +#: check50/__main__.py:185 +msgid "logout of check50" +msgstr "đăng xuất khỏi check50" + +#: check50/__main__.py:192 +msgid "failed to logout" +msgstr "không đăng xuất được" + +#: check50/__main__.py:194 +msgid "logged out successfully" +msgstr "đăng xuất thành công" + +#: check50/__main__.py:200 +#, python-brace-format +msgid "Could not find checks for {}." +msgstr "Không tìm thấy checks cho {}." + +#: check50/__main__.py:204 +msgid " Did you mean:" +msgstr " Ý bạn là:" + +#: check50/__main__.py:207 +msgid "" +"\n" +"Do refer back to the problem specification if unsure." +msgstr "" +"\n" +"Vui lòng xem lại hướng dẫn của bài tập này nếu không chắc chắn." + +#: check50/__main__.py:210 +msgid "" +"\n" +"If you are confident the slug is correct and you have an internet " +"connection, try running without --offline." +msgstr "" +"\n" +"Nếu bạn chắc chắn slug này đúng và bạn đã kết nối internet, " +"hãy thử chạy mà không dùng --offline." + +#: check50/__main__.py:249 +#, python-brace-format +msgid "You should always use --local when using: {}" +msgstr "Bạn nên luôn sử dụng --local khi dùng: {}" + +#: check50/__main__.py:255 +#, python-brace-format +msgid "Duplicate output format specified: {}" +msgstr "Định dạng đầu ra bị trùng lập: {}" + +#: check50/__main__.py:262 +msgid "--ansi-log has no effect when ansi is not among the output formats" +msgstr "--ansi-log không có tác dụng nếu ansi không nằm trong các định dạng đầu ra" + +#: check50/__main__.py:298 +msgid "prescribed identifier of work to check" +msgstr "" + +#: check50/__main__.py:301 +msgid "" +"run check50 in development mode (implies --offline, and --log-level " +"info).\n" +"causes slug to be interpreted as a literal path to a checks package." +msgstr "" +"chạy check50 ở chế độ phát triển (nghĩa là dùng --offline và --log-level info).\n" +"slug sẽ được hiểu như đường dẫn tới checks package." + +#: check50/__main__.py:305 +msgid "" +"run checks completely offline (implies --local, --no-download-checks and " +"--no-install-dependencies)" +msgstr "" +"chạy kiểm tra hoàn toàn offline (có cả --local, --no-download-checks và --no-install-dependencies)" + +#: check50/__main__.py:308 +msgid "run checks locally instead of uploading to cs50" +msgstr "chạy kiểm tra ở máy cục bộ thay vì tải lên cs50" + +#: check50/__main__.py:314 +msgid "format of check results" +msgstr "định dạng kết quả kiểm tra" + +#: check50/__main__.py:318 +msgid "target specific checks to run" +msgstr "chỉ định kiểm tra cụ thể để chạy" + +#: check50/__main__.py:322 +msgid "file to write output to" +msgstr "tập tin để ghi kết quả đầu ra" + +#: check50/__main__.py:327 +msgid "" +"warning: displays usage warnings.\n" +"info: adds all commands run, any locally installed dependencies and print" +" messages.\n" +"debug: adds the output of all commands run." +msgstr "" +"warning: hiển thị cảnh báo sử dụng.\n" +"info: thêm tất cả lệnh đã chạy, các dependency cài cục bộ và các thông báo print.\n" +"debug: thêm toàn bộ đầu ra của mọi lệnh đã chạy." + +#: check50/__main__.py:332 +msgid "display log in ansi output mode" +msgstr "hiển thị log ở chế độ đầu ra ansi" + +#: check50/__main__.py:335 +msgid "" +"do not download checks, but use previously downloaded checks instead " +"(only works with --local)" +msgstr "không tải checks mới, sử dụng gói đã tải trước đó (chỉ hoạt động với --local)" + +#: check50/__main__.py:338 +msgid "do not install dependencies (only works with --local)" +msgstr "không cài đặt dependencies (chỉ hoạt động với --local)" + +#: check50/__main__.py:371 +#, python-brace-format +msgid "{} is not a directory" +msgstr "{} không phải là thư mục" + +#: check50/__main__.py:377 +msgid "" +"check50 could not retrieve checks from GitHub. Try running check50 again " +"with --offline." +msgstr "check50 không thể lấy checks từ GitHub. Vui lòng thử lại với --offline." + +#: check50/__main__.py:455 +#, python-brace-format +msgid "To see more detailed results go to {}" +msgstr "Để xem kết quả chi tiết hơn, hãy truy cập {}" + +#: check50/_api.py:81 +#, python-brace-format +msgid "hashing {}..." +msgstr "đang hash {}..." + +#: check50/_api.py:104 +#, python-brace-format +msgid "checking that {} exists..." +msgstr "đang kiểm tra {} tồn tại..." + +#: check50/_api.py:106 check50/_exceptions.py:42 +#, python-brace-format +msgid "{} not found" +msgstr "không tìm thấy {}" + +#: check50/_api.py:158 +#, python-brace-format +msgid "running {}..." +msgstr "đang chạy {}..." + +#: check50/_api.py:192 +#, python-brace-format +msgid "sending input {}..." +msgstr "đang gửi đầu vào {}..." + +#: check50/_api.py:198 +msgid "expected prompt for input, found none" +msgstr "dự kiến chương trình sẽ hỏi nhập dữ liệu, nhưng không có gì hiển thị" + +#: check50/_api.py:200 check50/_api.py:293 check50/_api.py:370 +msgid "output not valid ASCII text" +msgstr "đầu ra không hợp lệ (không phải văn bản ASCII)" + +#: check50/_api.py:275 +msgid "checking for EOF..." +msgstr "đang kiểm tra EOF..." + +#: check50/_api.py:278 +#, python-brace-format +msgid "checking for output \"{}\"..." +msgstr "đang kiểm tra đầu ra \"{}\"..." + +#: check50/_api.py:290 +#, python-brace-format +msgid "check50 waited {} seconds for the output of the program" +msgstr "check50 đã đợi {} giây để nhận đầu ra từ chương trình" + +#: check50/_api.py:295 +msgid "check50 could not verify output" +msgstr "check50 không thể xác thực đầu ra" + +#: check50/_api.py:312 +msgid "checking that input was rejected..." +msgstr "đang kiểm tra dữ liệu nhập bị từ chối..." + +#: check50/_api.py:319 +msgid "expected program to reject input, but it did not" +msgstr "chương trình cần phải từ chối đầu vào này, nhưng lại không từ chối" + +#: check50/_api.py:351 +#, python-brace-format +msgid "checking that program exited with status {}..." +msgstr "đang kiểm tra chương trình thoát với mã trạng thái {}..." + +#: check50/_api.py:353 +#, python-brace-format +msgid "expected exit code {}, not {}" +msgstr "dự kiến mã thoát là {}, không phải {}" + +#: check50/_api.py:368 +msgid "timed out while waiting for program to exit" +msgstr "hết thời gian chờ chương trình thoát" + +#: check50/_api.py:375 +msgid "failed to execute program due to segmentation fault" +msgstr "không thể chạy chương trình do lỗi segmentation fault" + +#: check50/_api.py:428 +#, python-brace-format +msgid "Did not find {} in {}" +msgstr "Không tìm thấy {} trong {}" + +#: check50/_api.py:464 +#, python-brace-format +msgid "" +"expected: {}\n" +" actual: {}" +msgstr "" +"dự kiến: {}\n" +" thực tế: {}" + +#: check50/_exceptions.py:50 +msgid "" +"Sorry, something is wrong! check50 ran into an error, please try again.\n" +"If the problem persists, please visit our status page " +"https://cs50.statuspage.io for more information." +msgstr "" +"Rất tiếc, có gì xảy ra, vui lòng thử nộp lại. Nếu vấn đề này còn tiếp nữa, " +"vui lòng xem https://cs50.statuspage.io để biết thêm thông tin." + +#: check50/_simple.py:64 +#, python-brace-format +msgid "" +"{} is not a valid name for a check; check names should consist only of " +"alphanumeric characters, underscores, and spaces" +msgstr "" +"{} không phải là check hợp lệ; tên của check chỉ nên bao gồm " +"ký tự chữ, số, dấu gạch dưới (_) và khoảng trắng" + +#: check50/_simple.py:89 +msgid "You forgot a - in front of run" +msgstr "Bạn quên thêm dấu - phía trước run" + +#: check50/_simple.py:94 +#, python-brace-format +msgid "{} is not a valid command in check {}, use only: {}" +msgstr "{} không phải là lệnh hợp lệ trong kiểm tra {}, chỉ sử dụng: {}" + +#: check50/_simple.py:98 +#, python-brace-format +msgid "Missing {} in check {}" +msgstr "Thiếu {} trong kiểm tra {}" + +#: check50/c.py:43 +msgid "compile requires at least one file" +msgstr "biên dịch yêu cầu ít nhất một tập tin" + +#: check50/c.py:106 +msgid "checking for valgrind errors..." +msgstr "đang kiểm tra lỗi valgrind..." + +#: check50/c.py:129 +msgid "file" +msgstr "tập tin" + +#: check50/c.py:129 +msgid "line" +msgstr "dòng" + +#: check50/c.py:139 +msgid "valgrind tests failed; see log for more information." +msgstr "kiểm tra valgrind thất bại; xem log để biết thêm chi tiết." + +#: check50/flask.py:36 +#, python-brace-format +msgid "could not find {}" +msgstr "không tìm thấy {}" + +#: check50/flask.py:44 +#, python-brace-format +msgid "{} does not contain an app" +msgstr "{} không chứa ứng dụng (app)" + +#: check50/flask.py:110 +#, python-brace-format +msgid "checking that status code {} is returned..." +msgstr "đang kiểm tra trả về mã trạng thái {}..." + +#: check50/flask.py:112 +#, python-brace-format +msgid "expected status code {}, but got {}" +msgstr "dự kiến mã trạng thái {}, nhưng nhận được {}" + +#: check50/flask.py:123 +#, python-brace-format +msgid "expected request to return HTML, but it returned {}" +msgstr "yêu cầu dự kiến trả về HTML, nhưng lại trả về {}" + +#: check50/flask.py:140 +#, python-brace-format +msgid "sending {} request to {}" +msgstr "đang gửi yêu cầu {} đến {}" + +#: check50/flask.py:144 +#, python-brace-format +msgid "exception raised in application: {}: {}" +msgstr "ứng dụng phát sinh ngoại lệ: {}: {}" + +#: check50/flask.py:145 +msgid "application raised an exception (see the log for more details)" +msgstr "ứng dụng phát sinh ngoại lệ (xem log để biết thêm chi tiết)" + +#: check50/flask.py:155 +#, python-brace-format +msgid "checking that \"{}\" is in page" +msgstr "đang kiểm tra \"{}\" có trong trang hay không" + +#: check50/flask.py:161 +#, python-brace-format +msgid "expected to find \"{}\" in page, but it wasn't found" +msgstr "dự kiến sẽ tìm thấy \"{}\" trong trang, nhưng không tìm thấy" + +#: check50/internal.py:121 check50/internal.py:128 +msgid "Invalid slug for check50. Did you mean something else?" +msgstr "Slug không hợp lệ cho check50. Có phải bạn định nhập nội dung khác?" + +#: check50/internal.py:190 +msgid "yes" +msgstr "có" + +#: check50/internal.py:190 +#, python-brace-format +msgid "{} [Y/n] " +msgstr "{} [Y/n] " + +#: check50/py.py:43 +#, python-brace-format +msgid "importing {}..." +msgstr "đang import {}..." + +#: check50/py.py:57 +#, python-brace-format +msgid "compiling {} into byte code..." +msgstr "đang biên dịch {} thành mã byte..." + +#: check50/py.py:62 +msgid "Exception raised: " +msgstr "Phát sinh ngoại lệ: " + +#: check50/py.py:66 +#, python-brace-format +msgid "{} raised while compiling {} (see the log for more details)" +msgstr "{} phát sinh khi biên dịch {} (xem log để biết thêm chi tiết)" + +#: check50/runner.py:57 +#, python-brace-format +msgid "check timed out after {} seconds" +msgstr "kiểm tra bị quá thời gian sau {} giây" + +#: check50/runner.py:152 +msgid "check50 ran into an error while running checks!" +msgstr "check50 gặp lỗi khi thực hiện kiểm tra!" + +#: check50/runner.py:241 +#, python-brace-format +msgid "Unknown check: {}" +msgstr "Kiểm tra chưa biết: {}" + +#: check50/runner.py:268 +msgid "can't check until a frown turns upside down" +msgstr "chưa thể kiểm tra cho đến khi bạn mỉm cười" + +#: check50/renderer/_renderers.py:74 +#, python-brace-format +msgid "Results for {} generated by check50 v{}" +msgstr "Kết quả cho {} được tạo bởi check50 v{}" + +#: check50/renderer/_renderers.py:82 +msgid "check skipped" +msgstr "bỏ qua kiểm tra" From bcc5bf432563fb6aaa019fc854ada03c8c092d91 Mon Sep 17 00:00:00 2001 From: Brandon Nguyen <112731698+bxngyn@users.noreply.github.com> Date: Thu, 7 Aug 2025 11:20:58 -0400 Subject: [PATCH 3/3] draft of lang contribution guideline --- CONTRIBUTING_LANG.md | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 CONTRIBUTING_LANG.md diff --git a/CONTRIBUTING_LANG.md b/CONTRIBUTING_LANG.md new file mode 100644 index 0000000..394bc4c --- /dev/null +++ b/CONTRIBUTING_LANG.md @@ -0,0 +1,48 @@ +# Check50 Language Translations +Thank you for your interest in making CS50's tooling more accessible for all. Before contributing, please read this in full to avoid any complications. + +## Instructions +CS50 uses GitHub to host code, track issues and feature requests, as well as accept pull requests. Please do not email staff members regarding specific issues or features. + +In order to add or edit a language for `check50`, please follow these steps. + +1. Fork the `check50` repository. +2. Once in the `check50` directory, run `pip install babel` and `pip install -e .` +3. If the language you are looking to add already exists in `check50/locale/`, please skip to step 6. + - See all of the 2 letter language codes [here](https://www.loc.gov/standards/iso639-2/php/code_list.php) +4. Generate the template of strings to translate by running `python3 setup.py extract_messages`. This will create a file in `check50/locale/` called `check50.pot` +5. Run `python setup.py init_catalog -l `, where `` is the 2 letter language code (see [here](https://www.loc.gov/standards/iso639-2/php/code_list.php)), to create a file called `check50.po` located at `check50/locale//LC_MESSAGES/`. This file is where the translations will be inputted. +6. The original English strings are found at every `msgid` occurence. Translations should be inputted directly under at every `msgstr` occurence. +7. To test your translations, run `python3 setup.py compile_catalog` to compile the `check50.po` file into `check50.mo`. +8. `pip3 install .` to install the new version of `check50` containing these translations. + +## Design and Formatting +Please follow the formatting of the `msgstr` English strings. For example, if the `msgid` string is + +``` +msgid "" +"check50 is not intended for use in interactive mode. Some behavior may " +"not function as expected." +``` + +The `msgstr` string should replicate the spacing of the English string. + +Example: +``` +msgstr "" +"check50 không thể sử dụng bằng chế độ tương tác, có thể " +"không hoạt động như mong đợi." +``` + +Instead of: +``` +msgstr "" +"check50 không thể sử dụng bằng chế độ tương tác, có thể không hoạt động như mong đợi." +``` + + +## Translation Error Reports + + +## References +This document was adapted from the open-source contribution guidelines for [Meta's Draft](https://github.com/facebookarchive/draft-js/blob/main/CONTRIBUTING.md)