Skip to content

Commit

Permalink
move file and react to changes
Browse files Browse the repository at this point in the history
  • Loading branch information
valchx committed Sep 30, 2023
1 parent db0b8f1 commit f287231
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions init.lua → lua/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ local function get_translation_for_key(key)
if result[part] then
result = result[part]
else
print("i18n : Not found " .. part)
result = "[error] Not found"
end
end
Expand Down Expand Up @@ -112,9 +111,6 @@ local function apply_translations()
end

local M = {
exec = function()
apply_translations()
end,
init = function()
local group = vim.api.nvim_create_augroup("i18n_tools", {})
vim.api.nvim_create_autocmd("BufEnter", {
Expand All @@ -124,6 +120,13 @@ local M = {
apply_translations()
end,
})
vim.api.nvim_create_autocmd("BufWrite", {
pattern = "*.{ts,js,tsx,jsx}",
group = group,
callback = function()
apply_translations()
end,
})
end,
}

Expand Down

0 comments on commit f287231

Please sign in to comment.