@@ -11,7 +11,7 @@ import { AllyError, ErrorType } from '../Errors'
11
11
import { Analyst , Global , Config } from '..'
12
12
import { Telemetry , TelemetryKey } from '../Telemetry'
13
13
import { Loader } from './Loader'
14
- import { ReplaceLocale , Log , applyPendingToObject , unflatten , NodeHelper , getCache , setCache } from '~/utils'
14
+ import { ReplaceLocale , Log , applyPendingToObject , unflatten , NodeHelper , getCache , setCache , getLocaleCompare } from '~/utils'
15
15
import i18n from '~/i18n'
16
16
17
17
const THROTTLE_DELAY = 1500
@@ -325,7 +325,10 @@ export class LocaleLoader extends Loader {
325
325
const processingContext = { locale, targetFile : filepath }
326
326
const processed = this . deprocessData ( modified , processingContext )
327
327
328
- await parser . save ( filepath , processed , Config . sortKeys )
328
+ const compare = Config . sortCompare === 'locale'
329
+ ? getLocaleCompare ( Config . sortLocale , locale )
330
+ : undefined
331
+ await parser . save ( filepath , processed , Config . sortKeys , compare )
329
332
330
333
if ( this . _files [ filepath ] ) {
331
334
this . _files [ filepath ] . value = modified
0 commit comments