If there isn't an open issue for what you are going to work on, please open an issue before writing codes for a pull request, for these reasons:
.clang-format
to format your codes. If anything wrong happens during formatting, try updating your clang-format
to the latest version.The documentation is hosted at cpeditor.github.io. You can read its contributing guidelines for more information.
The translations are in the translations directory. It's recommended to use Qt Linguist to edit them. However, if you only want to fix a typo, you can use whatever text editor you like. In Qt Linguist, when a translation is finished, press Ctrl + Enter to mark it as finished and go to the next unfinished translation. If a text doesn't need translation, for example, "C++", you can leave the translation empty and mark it as finished. You should fix all warnings in Qt Linguist.
If you want to add a new language, you can ask the developers for help. For example, you can open an issue for the language you want (it will be better if you can contribute the translations after we finish the preparation for you).
If you want to go a step further: The translated strings are wrapped in tr()
in the source codes. When the codes are changed, you can run updateTranslation.sh or updateTranslation.bat to update the translations. You can read Qt Linguist Manual if you are interested in it.
The basic structure of the settings system is:
settings.json
is translated to SettingsHelper.hpp
and SettingsInfo.cpp
by genSettings.py.SettingsInfo
to generate the page.SettingsHelper.hpp
or use SettingsManager to manage the settings. The purpose of SettingsHelper.hpp
is to enable auto-complete during development and reduce the chance of misspelling the name of a setting. SettingsManager
is usually used in cases where the name of the setting is a variable, for example: SettingsManager::get(QString("%1/Compile Command").arg(language)).toString()
.To learn how to add/modify settings, you can refer to other settings or read the documentation. Basically, you need to modify settings.json and the part starts with AddPageHelper(this)
in PreferencesWindow.cpp.
qDebug()
in the codes, which is a quick way to catch common mistakes.git submodule update --init --recursive
to update submodules.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。