Skip to content

Commit

Permalink
change API
Browse files Browse the repository at this point in the history
  • Loading branch information
LorisSigrist committed Oct 17, 2023
1 parent 0c88fa8 commit 7cbedaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/core/codegen/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { MessageCatalogue } from "../MessageCatalogue.js";

/**
* Generates the code for the "$t18s" module
* @param {Iterable<string>} localesIterable
* @param {MessageCatalogue} Catalogue
* @param {boolean} verbose
* @returns {string}
*/
export function generateMainModuleCode(localesIterable, verbose) {
const locales = Array.from(localesIterable);
export function generateMainModuleCode(Catalogue, verbose) {
const locales = [...Catalogue.getLocales()];

return `
import { writable, get } from 'svelte/store';
Expand Down
3 changes: 1 addition & 2 deletions src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,7 @@ function getRuntimeEntryPath() {
*/
async function loadMainModule(resolved_id, Catalogue) {
if (resolved_id === RESOLVED_VIRTUAL_MODULE_PREFIX) {
const locales = Catalogue.getLocales();
return generateMainModuleCode(locales, false);
return generateMainModuleCode(Catalogue, false);
}
return null;
}
Expand Down

0 comments on commit 7cbedaa

Please sign in to comment.