Skip to content

Commit

Permalink
Fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Dec 27, 2024
1 parent 7183bf6 commit e00a5ed
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions examples/expo/languine.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from "languine";

export default defineConfig({
version: "0.6.9",
version: "7.0.0",
locale: {
source: "en",
targets: ["es"],
Expand All @@ -15,4 +15,4 @@ export default defineConfig({
provider: "openai",
model: "gpt-4-turbo",
},
};)
});
14 changes: 7 additions & 7 deletions examples/expo/locales/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// For more information on Expo Localization and usage: https://docs.expo.dev/guides/localization
import { getLocales } from "expo-localization";
import { I18n } from "i18n-js";
import { getLocales } from 'expo-localization';
import { I18n } from 'i18n-js';

const translations = {
en: require("./en.json"),
es: require("./es.json"),
};
en: require('./en.json'),
es: require('./es.json')
}

const i18n = new I18n(translations);

i18n.locale = getLocales().at(0)?.languageCode ?? "en";
i18n.locale = getLocales().at(0)?.languageCode ?? 'en';

i18n.enableFallback = true;

export default i18n;
export default i18n;
2 changes: 1 addition & 1 deletion examples/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"expo-system-ui": "~4.0.6",
"expo-web-browser": "~14.0.1",
"i18n-js": "^4.5.1",
"languine": "workspace:*",
"languine": "^7.0.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-native": "0.76.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "languine",
"version": "7.0.0",
"version": "7.0.1",
"type": "module",
"bin": "dist/index.js",
"main": "dist/config.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ export function generateConfig({
provider: "${provider}",
model: "${model}",
},
};`;
}`;

if (configType === "mjs") {
return `export default ${configBody}`;
return `export default ${configBody};`;
}

return `import { defineConfig } from "languine";
export default defineConfig(${configBody})`;
export default defineConfig(${configBody});`;
}

export async function configFile(configType?: string) {
Expand Down

0 comments on commit e00a5ed

Please sign in to comment.