Skip to content

Commit

Permalink
fix: translations
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Feb 16, 2024
1 parent 9b7c78b commit 93037f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/commands/localization/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export default class extends Command {

// public
async run () {
const rootPackage = this._findRootPackage();

// XXX if root not founsd - start from the current dir
// const rootPackage = this._findRootPackage();
const rootPackage = this._findNearestPackage();

if ( !rootPackage ) this._throwError( `Unable to find root package` );

Expand Down
9 changes: 9 additions & 0 deletions lib/get-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,16 @@ export default class GetText {
const plural = this.#parseMessage( node.arguments[ 1 ], {
start,
} );

// XXX
if ( !plural.value ) return;

// XXX
if ( !plural.isTemplate ) throw `Plural message must be msgid taggeed template`;

// XXX
if ( !msgId.isTemplate ) throw `Single form message used with plurak form must be msgid taggeed template`;

message.pluralId = plural.value;
if ( plural.isTemplate ) message.flags = [ "javascript-format" ];
}
Expand Down

0 comments on commit 93037f9

Please sign in to comment.