Comments (8)
I'm not sure about it, but maybe a solution is to remove the import type nextI18NextConfig from '../../next-i18next.config.js';
from the translate.ts
.
import { i18n } from 'next-i18next';
import type nextI18NextConfig from '../../next-i18next.config.js';
type Namespace = 'common' | 'agent' | 'constants' | 'message';
export const translate = (
key: string,
text?: string | undefined | null,
ns?: Namespace | null
) => {
const opts = !!ns ? { ns } : undefined;
const defaultText = text ? text : key;
return i18n?.t(key, defaultText, opts) ?? key;
};
change to:
import { i18n } from 'next-i18next';
type Namespace = 'common' | 'agent' | 'constants' | 'message';
export const translate = (
key: string,
text?: string | undefined | null,
ns?: Namespace | null
) => {
const opts = !!ns ? { ns } : undefined;
const defaultText = text ? text : key;
return i18n?.t(key, defaultText, opts) ?? key;
};
from babyagi-ui.
One possible solution can be to change the nextI18NextConfig.ns as Array<string>
to nextI18NextConfig.ns as string[]
. I hope it will solve the problem, let me know if you are still facing with error or warning after changes.
from babyagi-ui.
Found the cause!
There was a place where translate("key", "defaultValue", 'namespace')
was being used as translate("key", 'namespace')
. Therefore, namespace would fall back to the default namespace common
and the specified key would not be found. I'll fix it.
from babyagi-ui.
Thanks for the feedback!
The Translator module I wrote has some bugs and not so dynamic to handle automatically the missing key/value pairs etc..., but I'm working on it to makes the translations interactive mode.
Currently this is the working mechanism of the Translator module:
When there is a new static text to translate you can just easily use the translate("{key}", "{default text in English}", "{namespace}")
syntax.
If you run the translator script (npm run translate
) it will find and process the mentioned formula in every .ts
and .tsx
file;
It will extract "key/text/namespace" combinations into an array then translates the text to the selected target language.
So you can use en as source and en as target and it will create the complete English translation and its JSON files; After overwrite the old files - and move the new ones if they are - in the public/locales/en/
directory just easily run again the translator script with an other target language to create the desired complete translation.
When the extraction is done it will change the source code of the file - where from the translatable part has been extracted - to the single translate("{key}", "{namespace}")
syntax.
I'm happy about that you could fix the error! π₯³
Unfortunately I'm not a Twitter user (yet, already, yet... I don't know), but I appreciate your mention willingness with a link or just simply using my nick. π
I'm following this project, so if I have something, you will be notified, and soms I'll take a look on translations and other upgrades too... πΈ π¦Ύ π€ π
from babyagi-ui.
OK! I'll introduce you using the link π’
And the translator is great. Thank you for improving it. I'll check the PR π«‘
Indeed, it's like a Translator Agent! Isn't it amazing to have an agent on the code side of the autonomous agent (BabyAGI) product? Apart from this PR, if you don't mind, I'd like to have a casual chat about expanding the Translator Agent. What tool should we use? Should we create a Discord for BabyAGI-UI?
from babyagi-ui.
Thank you very much, great cooperation! π Mine is the honor to be a member of this project too especially of this development process and in the future, I will be happy to lend a helping hand in the development of the project as my time β°, competence πͺ, and energy β‘ allow.
I'm 100% active π₯ and most of the time 0/24 available on Discord. It would be great if you can also move there with the project. There are a lot of users π₯ and a perfect platform for the marketing π£ and for growing the community π who are interested in the BabyAGI and BabyAGI-UI.
By all means, let's continue a conversation about the module, because BabyAGI is not the first project it has been integrated into... more precisely, it is the first in its form. I have already created a repository ποΈ and I would like to create it as a node module which can be installed by npm install
π¦
from babyagi-ui.
I deployed and tried it and the error was gone, but I got the same symptoms.
I ran it locally to try and reproduce it, so it may be due to a change in the last commit.
from babyagi-ui.
I deployed your code π
Thank you again for your contribution. Your prompt response was very helpful.
I'd like to mention you in the update announcement, do you have a Twitter account? If so, please let me know.
from babyagi-ui.
Related Issues (20)
- Add BabyElfAGI
- download all task and activities even stop process HOT 6
- To execute skills on the server side
- Create a code_reviewer skill
- Support the Llam2 model HOT 1
- Support Huggingface Inference API HOT 9
- Uncaught (in promise) Error - Agente: BabyElfAGI HOT 8
- Correct the untranslated text
- Error occurs in WebLoader Skill HOT 1
- Add Multi-on skill
- Add cache to Objective loader
- Offline vector DB support HOT 1
- Aggregate agent logic
- The β Network connection lostβ error is occurring
- Write a description and sample code for `useAgent` in the ReadMe
- Integration of Together.ai with babyagi-ui HOT 2
- Support GPT-4 Turbo with 128K context
- Fetch Failed Error HOT 1
- Add read PDF links skill
- where is updates or you move to another repo? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babyagi-ui.