Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dot in front of "po" #19

Merged
merged 1 commit into from
Dec 27, 2024
Merged

Conversation

schjonhaug
Copy link
Contributor

I wanted to try Languine with po files and noticed an error:

npx languine@latest                       20s

    ██╗      █████╗ ███╗   ██╗ ██████╗ ██╗   ██╗██╗███╗   ██╗███████╗
    ██║     ██╔══██╗████╗  ██║██╔════╝ ██║   ██║██║████╗  ██║██╔════╝
    ██║     ███████║██╔██╗ ██║██║  ███╗██║   ██║██║██║██╗ ██║█████╗
    ██║     ██╔══██║██║╚██╗██║██║   ██║██║   ██║██║██║╚██╗██║██╔══╝
    ███████╗██║  ██║██║ ╚████║╚██████╔╝╚██████╔╝██║██║ ╚████║███████╗
    ╚══════╝╚═╝  ╚═╝╚═╝  ╚═══╝ ╚═════╝  ╚═════╝ ╚═╝╚═╝  ╚═══╝╚══════╝

Translate your application with Languine CLI powered by AI.
Website: https://languine.ai

│
◇  What would you like to do?
│  Initialize a new Languine configuration
┌  Let's set up your i18n configuration
│
◇  What is your source language?
│  English
│
◇  What languages do you want to translate to?
│  no
│
◇  What format should language files use?
│  Gettext (.po)
file:///Users/andreas/.npm/_npx/8e2b6b35c5047a76/node_modules/languine/dist/index.js:356
      throw new Error(`Unsupported format: ${format}`);
            ^

Error: Unsupported format: po
    at getDefaultPattern (file:///Users/andreas/.npm/_npx/8e2b6b35c5047a76/node_modules/languine/dist/index.js:356:13)
    at init (file:///Users/andreas/.npm/_npx/8e2b6b35c5047a76/node_modules/languine/dist/index.js:400:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    

Looks like the issue was that a dot was prefixing po in switch that checked for valid file extensions in getDefaultPattern.

After removing it, I was able to create a config file:

   ◇  What format should language files use?
│  Gettext (.po)
│
◇  Where should language files be stored?
│  locales/[locale].po
│
◇  Which provider would you like to use?
│  OpenAI
│
◇  Which model should be used for translations?
│  GPT-4 Turbo (Default)
│
└  Configuration file and language files/directories created successfully!

Copy link

vercel bot commented Dec 26, 2024

@schjonhaug is attempting to deploy a commit to the Pontus Abrahamsson's projects Team on Vercel.

A member of the Team first needs to authorize it.

@pontusab pontusab merged commit 914d7a3 into midday-ai:main Dec 27, 2024
1 check failed
@schjonhaug schjonhaug deleted the remove-dot-on-po branch December 27, 2024 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants