@@ -8,15 +8,15 @@ import { qs } from './lib/dom';
88import { notify } from './lib/notify' ;
99import { setStatus } from './lib/status' ;
1010import { destroyOverlayScrollbarsFor , initOverlayScrollbarsFor , refreshOverlayScrollbarsFor } from './lib/scrollbars' ;
11- import { prefs , state , hasRepo } from './state/state' ;
11+ import { prefs , state , hasRepo , resolveVcsActionLabel } from './state/state' ;
1212import {
1313 bindTabs , initResizer , refreshRepoActions , setRepoHeader , resetRepoHeader , setTab , setTheme ,
1414 bindLayoutActionState
1515} from './ui/layout' ;
1616import { clearPluginMenubarMenus , initMenubar , refreshPluginMenubarMenus } from './ui/menubar' ;
1717import { closeAllModals } from './ui/modals' ;
1818import { bindCommandSheet , openSheet , closeSheet } from './features/commandSheet' ;
19- import { bindRepoHotkeys , bindFilter , renderList , wireRenderListCallbacks , hydrateBranches , hydrateStatus , hydrateCommits , hydrateStash , yieldToPaint } from './features/repo' ;
19+ import { bindRepoHotkeys , bindFilter , renderList , wireRenderListCallbacks , hydrateBranches , hydrateStatus , hydrateCommits , hydrateStash , hydrateVcsActionLabels , yieldToPaint } from './features/repo' ;
2020import { bindBranchUI } from './features/branches' ;
2121import { bindCommit } from './features/diff' ;
2222import { openAbout } from './features/about' ;
@@ -188,7 +188,7 @@ async function boot() {
188188 const ctl = status ?? statusController ( ) ;
189189 let success = false ;
190190 try {
191- ctl . setBusy ( 'Fetching…' ) ;
191+ ctl . setBusy ( ` ${ resolveVcsActionLabel ( 'VCS.Fetch' , 'Fetch' ) } …` ) ;
192192 await TAURI . invoke ( 'vcs_fetch' , { } ) ;
193193 notify ( 'Fetched' ) ;
194194 if ( hydrate ) {
@@ -243,10 +243,12 @@ async function boot() {
243243 const behind = getBehindCount ( ) ;
244244 const repoOn = hasRepo ( ) ;
245245 const canPull = repoOn ;
246- const mainLabel = behind > 0 ? `Pull (${ behind } )` : 'Fetch' ;
246+ const fetchLabel = resolveVcsActionLabel ( 'VCS.Fetch' , 'Fetch' ) ;
247+ const pullLabel = resolveVcsActionLabel ( 'VCS.Pull' , 'Pull' ) ;
248+ const mainLabel = behind > 0 ? `${ pullLabel } (${ behind } )` : fetchLabel ;
247249 const mainTitle = behind > 0
248- ? `Pull ${ behind } commit${ behind === 1 ? '' : 's' } (F5)`
249- : 'Fetch (F5)' ;
250+ ? `${ pullLabel } ${ behind } commit${ behind === 1 ? '' : 's' } (F5)`
251+ : ` ${ fetchLabel } (F5)` ;
250252
251253 if ( fetchBtn ) {
252254 fetchBtn . textContent = mainLabel ;
@@ -262,18 +264,18 @@ async function boot() {
262264 fetchOnlyItem . setAttribute ( 'aria-disabled' , 'false' ) ;
263265 fetchOnlyItem . tabIndex = 0 ;
264266 const name = fetchOnlyItem . querySelector < HTMLElement > ( '.name' ) ;
265- if ( name ) name . textContent = 'Fetch' ;
267+ if ( name ) name . textContent = fetchLabel ;
266268 }
267269 if ( fetchAllItem ) {
268270 fetchAllItem . setAttribute ( 'aria-disabled' , 'false' ) ;
269271 fetchAllItem . tabIndex = 0 ;
270272 }
271273 if ( pullItem ) {
272- const pullLabel = behind > 0 ? `Pull (${ behind } )` : 'Pull' ;
274+ const pullText = behind > 0 ? `${ pullLabel } (${ behind } )` : pullLabel ;
273275 pullItem . setAttribute ( 'aria-disabled' , canPull ? 'false' : 'true' ) ;
274276 pullItem . tabIndex = canPull ? 0 : - 1 ;
275277 const name = pullItem . querySelector < HTMLElement > ( '.name' ) ;
276- if ( name ) name . textContent = pullLabel ;
278+ if ( name ) name . textContent = pullText ;
277279 }
278280 }
279281
@@ -283,7 +285,7 @@ async function boot() {
283285 if ( ! fetched ) { ctl . clearBusy ( ) ; return ; }
284286
285287 try {
286- ctl . setBusy ( 'Pulling…' ) ;
288+ ctl . setBusy ( ` ${ resolveVcsActionLabel ( 'VCS.Pull' , 'Pull' ) } ing…` ) ;
287289 const res = await TAURI . invoke < { pulled : boolean ; branch : string ; reason ?: string | null } > ( 'vcs_pull' , { } ) ;
288290 if ( res ?. pulled ) {
289291 notify ( 'Pulled latest changes' ) ;
@@ -296,7 +298,7 @@ async function boot() {
296298 ctl . clearBusy ( ) ;
297299 }
298300
299- await Promise . allSettled ( [ hydrateBranches ( ) , hydrateStatus ( ) , hydrateCommits ( ) , hydrateStash ( ) ] ) ;
301+ await Promise . allSettled ( [ hydrateBranches ( ) , hydrateStatus ( ) , hydrateCommits ( ) , hydrateStash ( ) , hydrateVcsActionLabels ( ) ] ) ;
300302 }
301303
302304 async function defaultFetchAction ( ) {
@@ -513,7 +515,7 @@ async function boot() {
513515
514516 await hydrateBranches ( ) ;
515517 setRepoHeader ( path ) ;
516- await Promise . allSettled ( [ hydrateStatus ( ) , hydrateCommits ( ) ] ) ;
518+ await Promise . allSettled ( [ hydrateStatus ( ) , hydrateCommits ( ) , hydrateVcsActionLabels ( ) ] ) ;
517519 updateFetchUI ( ) ;
518520
519521 // Broadcast app-level event so branch UI and actions can sync
@@ -569,7 +571,7 @@ async function boot() {
569571 if ( doFetch ) {
570572 await fetchCurrentRemoteOnly ( { hydrate : false } ) ;
571573 }
572- await Promise . allSettled ( [ hydrateBranches ( ) , hydrateStatus ( ) , hydrateCommits ( ) , hydrateStash ( ) ] ) ;
574+ await Promise . allSettled ( [ hydrateBranches ( ) , hydrateStatus ( ) , hydrateCommits ( ) , hydrateStash ( ) , hydrateVcsActionLabels ( ) ] ) ;
573575 updateFetchUI ( ) ;
574576 } ) ( ) ;
575577 try {
0 commit comments