![](/img/trans.png)
[英]Translate static string messages in ReactJs using lingui.js
我正在使用 lingui.js 並關注https://lingui.js.org/tutorials/react.html 。 我能夠設置項目並且它運行良好,還為圍繞Trans宏<Trans>Send Verification Code</Trans>的內容/元素生成 PO ...
[英]Translate static string messages in ReactJs using lingui.js
我正在使用 lingui.js 並關注https://lingui.js.org/tutorials/react.html 。 我能夠設置項目並且它運行良好,還為圍繞Trans宏<Trans>Send Verification Code</Trans>的內容/元素生成 PO ...
[英]Next JS Babel can't resolve 'module'
我已經開始使用 Next JS 和 Lingui.js 開發多語言 web 應用程序 Lingui.js 正在使用 babel,所以我也必須安裝它。 我遵循了本教程https://blog.logrocket.com/complete-guide-internationalization-next ...
[英]Lingui: Error: Objects are not valid as a React child (found: object with keys {id})
根據文檔,我們可以使用t宏而不是i18n._()調用。 對應的宏變換示例:import { t } from "@lingui/macro" const message = t`Hello World` // ↓ ↓ ↓ ↓ ↓ ↓ import { i18n } from "@lingui/ ...
[英]ReactJS - How to create a fallback language function with localeStorage
我在決定如何處理我的語言應用程序時遇到了一些麻煩。 正如您在下面看到的,我使用“window.localStorage.setItem(LOCAL_STORAGE_KEY, locale);” 獲取瀏覽器的語言環境。 我有兩種語言es和en。 但是當某人使用另一種不是 es 或 en 的語言時,例 ...
[英]React antd LinguiJS not working on Modal method
我試圖在 antd modal.confirm()中翻譯標題,但我總是收到錯誤useLingui hook was used without I18nProvider 。 在其他頁面中,翻譯工作正常。 這是我的代碼:async function onLogout() { Modal.conf ...
[英]Creating a language switcher for i18n app
我正在學習如何在應用程序上實現 Lingui(i18n)。 一切都設置好了,但我想知道我應該如何創建一個語言切換器來在我的應用程序上的語言目錄之間進行更改。 這是我的index.js文件 我的App.js文件 和i18n.ts文件 每次我指定 es、en 或 fr defaultLoc ...
[英]Language Switcher with Lingui (i18n), I want the language chosen to stay throughout the app even when refreshed
我正在為應用程序的 i18n 試用 Lingui。 我根據文檔和教程創建了一個語言切換器,但我想知道我應該如何設置它,以便每次我在應用程序中選擇一種語言時,它即使在刷新時也能保留在整個應用程序中。 目前我可以切換它並更改頁面,但每次刷新它都會回到英文。 這是我的文件: 索引.js 應用程序 ...
[英]Parsing JSON file to csv
我正在嘗試將 JSON 文件解析為 csv。我找到了一個 json2csv 庫,它的工作原理是它希望 json 文件以這種方式排列: 雖然我的 JSON 文件布局(來自 linguiJS 的翻譯)看起來像這樣: 所以它返回一個水平格式化的文件,如下所示: 轉換器js: 對於初學者來說,解決這個問 ...
[英]What catalog format from webtranslateit.com to select for LinguiJS that will work with plurals?
由於 i18next 的大包大小,我正在嘗試從 i18next 切換到 LinguiJS。 我使用 webtranslateit,它支持這些格式。 我目前在 webtranslateit 上使用 i18next.json v3 格式: webtranslateit 上 select 的哪種格式適 ...
[英]I faced with Invalid hook call on react
這是我為 lingui-js 制作導航器的腳本。 我在本地遇到了這個錯誤:× 錯誤:無效掛鈎調用。 鈎子只能在 function 組件的內部調用。 這可能由於以下原因之一而發生: 1. 你可能有不匹配的 React 版本和渲染器(例如 React DOM) 2. 你可能違反了 Hooks 規則 3. ...
[英]The Babel-core module not working with Lingui
我是本地化我的應用程序的新概念。 在進行了一些在線研究之后,似乎jsLingui是在我的React應用程序上使用和實現翻譯的最佳庫。 遵循https://lingui.js.org/tutorials/react.html的教程之后,一切似乎都非常簡單。 但是當我運行命令時 $ li ...