Added i18n support to dbsearch plugin#74
Added i18n support to dbsearch plugin#74luwei1970 wants to merge 1 commit intobarisusakli:masterfrom
Conversation
|
This is an improvement to the dbsearch plugin’s internationalization support—I’m really enjoying your plugin, thanks so much! |
|
@barisusakli I’ve submitted the i18n changes—could you please review them and invite me as a Collaborator? That way I can more easily follow up and merge in the future. Thanks! |
| results.plugin.progressData = await getProgress(); | ||
| results.plugin.title = 'DB Search'; | ||
| res.render('admin/plugins/dbsearch', results.plugin); | ||
| translator.translate('[[dbsearch:admin.title]]', function (translated) { |
There was a problem hiding this comment.
Don't have to manually translate title I think, you can just set results.plugin.title = '[[dbsearch:admin.title]] and it should be translated.
| route: '/plugins/dbsearch', | ||
| icon: 'fa-search', | ||
| name: 'DB Search', | ||
| translator.translate('[[dbsearch:admin.menuname]]', function (translated) { |
There was a problem hiding this comment.
no need for manualy translation just set name to [[dbsearch:admin.menuname]]
| const pubsub = require.main.require('./src/pubsub'); | ||
|
|
||
| let searchLanguage = 'english'; | ||
| let searchLanguage = 'chinese_zh'; |
| "license": "BSD-2-Clause", | ||
| "dependencies": { | ||
| "lodash": "4.17.21", | ||
| "nodebb-plugin-dbsearch": "file:", |
There was a problem hiding this comment.
I changed it to a local reference because I placed the plugin code in the src/plugins directory of the NodeBB project and bundled it for testing using the file: method. You can easily revert it to the original NPM installation method—just restore the plugin version number in the package.json (or remove this line entirely to return to the default dependency), then reinstall it.
|
Hi barisusakli, Thanks for adding me as a participant! I appreciate it and look forward to collaborating on this plugin. Let me know if there’s anything I can help with. Best, |
Modified /lib/dbsearch.js to add internationalization support—including ACP navigation menus and pages; updated the .tpl template file and provided en-GB and zh-CN language files.
修改了/lib/dbsearch.js,添加了国际化支持,包括(ACP导航菜单和页面);修改了 .tpl 模板文件并提供了 en-GB 和 zh-CN 语言文件。