Prepare IDE beta 6 with Turkish native dialogs and map errors
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import type { EN_SURFACES } from '@/i18n/en-surfaces'
|
||||
import { type BitReader, type BitWriter, createLoadout, Dict, idxOf, indexBits, LoadoutError } from '@/lib/loadout'
|
||||
import type { StarmapEdge, StarmapGraph, StarmapNode } from '@/types/hermes'
|
||||
|
||||
@@ -168,6 +169,13 @@ function readGraph(r: BitReader): StarmapGraph {
|
||||
|
||||
export class ShareCodeError extends LoadoutError {}
|
||||
|
||||
export function shareCodeErrorText(error: unknown, messages: typeof EN_SURFACES.mapErrors): string {
|
||||
if (!(error instanceof ShareCodeError) || !error.info) {return messages.unknown}
|
||||
const info = error.info
|
||||
|
||||
return info.kind === 'version' ? messages.version(info.actual, info.expected) : messages[info.kind]
|
||||
}
|
||||
|
||||
const codec = createLoadout<StarmapGraph>({
|
||||
error: ShareCodeError,
|
||||
noun: 'map code',
|
||||
|
||||
Reference in New Issue
Block a user