mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-10-26 11:38:32 +00:00
Fixed missing translations
Aligned the languge pack versions. Closes #1431 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
@@ -285,6 +285,29 @@ export namespace Port {
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
export namespace Protocols {
|
||||
export const KnownProtocolLiterals = ['serial', 'network'] as const;
|
||||
export type KnownProtocol = typeof KnownProtocolLiterals[number];
|
||||
export namespace KnownProtocol {
|
||||
export function is(protocol: unknown): protocol is KnownProtocol {
|
||||
return (
|
||||
typeof protocol === 'string' &&
|
||||
KnownProtocolLiterals.indexOf(protocol as KnownProtocol) >= 0
|
||||
);
|
||||
}
|
||||
}
|
||||
export const ProtocolLabels: Record<KnownProtocol, string> = {
|
||||
serial: nls.localize('arduino/portProtocol/serial', 'Serial'),
|
||||
network: nls.localize('arduino/portProtocol/network', 'Network'),
|
||||
};
|
||||
export function protocolLabel(protocol: string): string {
|
||||
if (KnownProtocol.is(protocol)) {
|
||||
return ProtocolLabels[protocol];
|
||||
}
|
||||
return protocol;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface BoardsPackage extends ArduinoComponent {
|
||||
|
||||
Reference in New Issue
Block a user