You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I will like for their to either be a way for me to change the name of titles like references, code actions, etc. so I can add my translations.
Or if this plugin had translations in it it will be great.
Reason
I am currently working on adding internationalization in my own setup , most so I can practice Japanese and not bother other people who might want it in english.
My Approach
I am getting the texts from plugins to exchange them with text that will be translated depending the vim language set.
To get the language set I am using a variable build in which Is
vim.v.lang
Once I get the language it changes the values depending on the languages available and translations.
For me I used a function that when text goes inside It tries to look for an available translation. if it doesnt have then it returns default string.
-- Current Languagelocallang=string.sub(vim.v.lang, 1, 2)
-- Translationslocalfile=io.open(vim.fn.stdpath('config').."/lua/andrem222/lang/"..lang..".json", "rb")
-- Decoded translationslocaljsonFile-- Check if translation available to decodeiffilethenjsonFile=vim.json.decode(file:read("*a"))
file:close()
end--- This function returns the translation if available of text in the parameter--- @paramdescriptionstring Description to translate--- @returnanyfunctionMsgstr(description)
ifnotjsonFilethenreturndescriptionendifnotjsonFile[description] orjsonFile[description]["msgstr"] =='' thenreturndescriptionendreturnjsonFile[description]["msgstr"]
end
NVim Approach
They instead used a cmakelist to get translations and exchange them using gettext.
This one might be better but I am still not knowledgable about that and I'm trying to learn it now to see how to make it work.
First of all great job on developing this plugin.
Feauture
I will like for their to either be a way for me to change the name of titles like references, code actions, etc. so I can add my translations.
Or if this plugin had translations in it it will be great.
Reason
I am currently working on adding internationalization in my own setup , most so I can practice Japanese and not bother other people who might want it in english.
My Approach
I am getting the texts from plugins to exchange them with text that will be translated depending the vim language set.
To get the language set I am using a variable build in which Is
Once I get the language it changes the values depending on the languages available and translations.
For me I used a function that when text goes inside It tries to look for an available translation. if it doesnt have then it returns default string.
NVim Approach
They instead used a cmakelist to get translations and exchange them using
gettext
.This one might be better but I am still not knowledgable about that and I'm trying to learn it now to see how to make it work.
https://github.com/neovim/neovim/blob/master/src/nvim/po/CMakeLists.txt
The text was updated successfully, but these errors were encountered: