File tree Expand file tree Collapse file tree 5 files changed +22
-8
lines changed
by-features/100-locales/.vscode Expand file tree Collapse file tree 5 files changed +22
-8
lines changed Original file line number Diff line number Diff line change 66 "i18n-ally.keystyle" : " nested" ,
77 "i18n-ally.translate.engines" : [" google-cn" ],
88 "i18n-ally.translate.parallels" : 5 ,
9- "i18n-ally.editor.preferEditor" : true ,
9+ // "i18n-ally.editor.preferEditor": true,
1010 "i18n-ally.review.removeCommentOnResolved" : true ,
1111 "i18n-ally.readonly" : false ,
12- "i18n-ally.enabledFrameworks" : " vue"
12+ "i18n-ally.enabledFrameworks" : [" vue" ],
13+ "i18n-ally.keepFulfilled" : true ,
1314}
Original file line number Diff line number Diff line change 11{
2- "name" : " ui5CliTest " ,
2+ "name" : " ui5-cli-test " ,
33 "description" : " " ,
44 "devDependencies" : {
55 "@ui5/cli" : " ^2.10.4"
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export async function FulfillMissingKeysForProgress(item: ProgressSubmenuItem) {
2929 return pendings
3030}
3131
32- export async function FulfillAllMissingKeys ( prompt = true ) {
32+ export async function FulfillAllMissingKeys ( prompt = true , extraKeys ?: string [ ] ) {
3333 if ( prompt ) {
3434 const Yes = i18n . t ( 'prompt.button_yes' )
3535 const result = await window . showWarningMessage (
@@ -44,7 +44,15 @@ export async function FulfillAllMissingKeys(prompt = true) {
4444 let pendings : PendingWrite [ ] = [ ]
4545 const loader = CurrentFile . loader
4646 for ( const locale of Global . visibleLocales ) {
47- const cov = loader . getCoverage ( locale )
47+ const keys = loader . keys
48+ if ( extraKeys ?. length ) {
49+ extraKeys . forEach ( ( i ) => {
50+ if ( ! keys . includes ( i ) )
51+ keys . push ( i )
52+ } )
53+ }
54+
55+ const cov = loader . getCoverage ( locale , keys )
4856 if ( ! cov )
4957 continue
5058
Original file line number Diff line number Diff line change 11import { Disposable } from 'vscode'
22import _ from 'lodash'
3+ import { uniq } from '@antfu/utils'
34import { PendingWrite } from '../types'
45import { Translator } from '../Translator'
56import { Config } from '../Config'
@@ -115,8 +116,12 @@ export class ComposedLoader extends Loader {
115116 if ( ! Array . isArray ( pendings ) )
116117 pendings = [ pendings ]
117118
118- if ( Config . keepFulfilled && triggerFullfilled )
119- pendings = [ ...await FulfillAllMissingKeys ( false ) || [ ] , ...pendings ]
119+ if ( Config . keepFulfilled && triggerFullfilled ) {
120+ pendings = [
121+ ...await FulfillAllMissingKeys ( false , uniq ( pendings . map ( i => i . keypath ) ) ) || [ ] ,
122+ ...pendings ,
123+ ]
124+ }
120125
121126 pendings = pendings . filter ( i => i )
122127
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export function flatten(data: any) {
3636export function unflatten ( data : any ) {
3737 const output : any = { }
3838
39- Object . keys ( data )
39+ Object . keys ( data || { } )
4040 . sort ( ( a , b ) => b . length - a . length )
4141 . forEach ( ( key ) => {
4242 const original = key
You can’t perform that action at this time.
0 commit comments