Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(i18n): experimental i18n Support (only client/common/inspector/interactive) #2553

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
286 changes: 278 additions & 8 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions crates/atuin-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ palette = { version = "0.7.5", features = ["serializing"] }
lazy_static = "1.4.0"
strum_macros = "0.26.3"
strum = { version = "0.26.2", features = ["strum_macros"] }
rust-i18n = "3.1.2"

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
Expand Down
298 changes: 298 additions & 0 deletions crates/atuin-client/locales/TODO.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,298 @@
_version: 2
Atuin version mismatch! In order to successfully sync, the server needs to run a newer version of Atuin:
en: Atuin version mismatch! In order to successfully sync, the server needs to run a newer version of Atuin
Client:
en: Client
Converting old history to new store:
en: Converting old history to new store
Could not build config:
en: Could not build config
Could not build default:
en: Could not build default
Could not convert color name %{name} to Crossterm color:
en: Could not convert color name %{name} to Crossterm color
Could not deserialize config:
en: Could not deserialize config
Could not determine home directory:
en: Could not determine home directory
'Could not find history file %{histfile}. Try setting $HISTFILE':
en: Could not find history file %{histfile}. Try setting $HISTFILE
Could not find history file.:
en: 'Could not find history file.'
Could not find history file. Try setting $HISTDB_FILE:
en: 'Could not find history file. Try setting $HISTDB_FILE'
Could not find history file. Try setting and exporting $HISTFILE:
en: 'Could not find history file. Try setting and exporting $HISTFILE'
'Could not find xonsh history db at: %{hist_file}':
en: 'Could not find xonsh history db at: %{hist_file}'
Could not find xonsh history files:
en: Could not find xonsh history files
'Could not load theme %{theme}':
en: 'Could not load theme %{theme}'
Could not login due to version mismatch:
en: Could not login due to version mismatch
Could not parse 3 hex values from string:
en: Could not parse 3 hex values from string
Could not write host ID to data dir:
en: Could not write host ID to data dir
Downloaded records:
en: Downloaded records
'Downloading %{records} records from %{host}/%{tag}':
en: 'Downloading %{records} records from %{host}/%{tag}'
'ERROR: Failed to find $ATUIN_SESSION in the environment. Check that you have correctly set up your shell.':
en: 'ERROR: Failed to find $ATUIN_SESSION in the environment. Check that you have correctly set up your shell.'
Empty theme directory override and could not find theme elsewhere:
en: Empty theme directory override and could not find theme elsewhere
Failed to build secrets regex:
en: Failed to build secrets regex
Failed to decrypt %{record}, deleting:
en: Failed to decrypt %{record}, deleting
Failed to deserialize theme:
en: Failed to deserialize theme
Failed to remove session file:
en: Failed to remove session file
Fetching history already in store:
en: Fetching history already in store
Fetching history from old database:
en: Fetching history from old database
Import complete:
en: Import complete
Invalid path for SQLite database:
en: Invalid path for SQLite database
Invalid request to the service:
en: Invalid request to the service
'Loaded: %{count}':
en: 'Loaded: %{count}'
No such color in palette:
en: No such color in palette
Parent requested but we hit the recursion limit:
en: Parent requested but we hit the recursion limit
Rate limited; please wait before doing that again:
en: Rate limited; please wait before doing that again
Re-encrypting local store with new key:
en: Re-encrypting local store with new key
Server:
en: Server
'Server not reporting its version: it is either too old or unhealthy':
en: 'Server not reporting its version: it is either too old or unhealthy'
'Service unavailable: check https://status.atuin.sh (or get in touch with your host)':
en: 'Service unavailable: check https://status.atuin.sh (or get in touch with your host)'
'There was an error with the atuin sync service, server error %{status}: %{reason}. If the problem persists, contact the host':
en: 'There was an error with the atuin sync service, server error %{status}: %{reason}. If the problem persists, contact the host'
'There was an error with the atuin sync service: Status %{status}. If the problem persists, contact the host':
en: 'There was an error with the atuin sync service: Status %{status}. If the problem persists, contact the host'
Time reversal detected in Bash history! Commands may be ordered incorrectly.:
en: 'Time reversal detected in Bash history! Commands may be ordered incorrectly.'
Tried to load session; not logged in:
en: Tried to load session; not logged in
Tried to load string as a color unsuccessfully:
en: Tried to load string as a color unsuccessfully
Unknown error:
en: Unknown error
Uploaded records:
en: Uploaded records
Uploading %{records} records to %{host}/%{tag}:
en: Uploading %{records} records to %{host}/%{tag}
Writing new key:
en: Writing new key
Writing to db:
en: Writing to db
You are not logged in:
en: You are not logged in
You have logged out!:
en: You have logged out!
Your theme config name is not the name of your loaded theme:
en: Your theme config name is not the name of your loaded theme
a request to the sync server failed:
en: a request to the sync server failed
an error occurred:
en: an error occurred
an issue with the local database occurred:
en: an issue with the local database occurred
attempting to decrypt with incorrect key. currently using %{current_kid}, expecting %{kid}:
en: 'attempting to decrypt with incorrect key. currently using %{current_kid}, expecting %{kid}'
bug in list query. please report:
en: 'bug in list query. please report'
bug in search query. please report:
en: 'bug in list query. please report'
cannot decrypt history from a different version of Atuin:
en: cannot decrypt history from a different version of Atuin
cannot decrypt history from a newer version of atuin:
en: cannot decrypt history from a newer version of atuin
could not create config file:
en: could not create config file
could not create dir %{config_dir}:
en: could not create dir %{config_dir}
could not create dir %{data_dir}:
en: could not create dir %{data_dir}
could not decode encryption key:
en: could not decode encryption key
could not decode provided key - is not valid base64:
en: could not decode provided key - is not valid base64
could not decrypt entry:
en: could not decrypt entry
could not decrypt history:
en: could not decrypt history
could not delete history with id %{id}, not found locally:
en: could not delete history with id %{id}, not found locally
could not determine data directory:
en: could not determine data directory
could not encode key to message pack:
en: could not encode key to message pack
could not encrypt:
en: could not encrypt
could not find user directories:
en: could not find user directories
could not get last element of page:
en: could not get last element of page
could not register user due to version mismatch:
en: could not register user due to version mismatch
could not serialize implicit assertions:
en: could not serialize implicit assertions
could not serialize wrapped cek:
en: could not serialize wrapped cek
could not source from random:
en: could not source from random
could not sync due to version mismatch:
en: could not sync due to version mismatch
could not sync records due to version mismatch:
en: could not sync records due to version mismatch
could not write default config file:
en: could not write default config file
current password is incorrect:
en: current password is incorrect
deleting %{id} on remote:
en: deleting %{id} on remote
diff has nothing for local or remote - (host, tag) does not exist:
en: diff has nothing for local or remote - (host, tag) does not exist
encryption key is not a valid base64 encoding:
en: encryption key is not a valid base64 encoding
encryption key is not the correct size:
en: encryption key is not the correct size
error encrypting atuin data:
en: error encrypting atuin data
expected an error decrypting with invalid key:
en: expected an error decrypting with invalid key
expected decoding v0 record, found v%{version}:
en: expected decoding v0 record, found v%{version}
failed to check sync:
en: failed to check sync
failed to create client:
en: failed to create client
failed to decrypt history! check your key:
en: failed to decrypt history! check your key
failed to deserialize:
en: failed to deserialize
failed to fetch local store len:
en: failed to fetch local store len
failed to fetch local store status:
en: failed to fetch local store status
failed to get count (are you logged in?):
en: failed to get count (are you logged in?)
failed to load host ID:
en: failed to load host ID
failed to open in memory sqlite:
en: failed to open in memory sqlite
failed to override timezone with UTC:
en: failed to override timezone with UTC
failed to parse host ID from local directory:
en: failed to parse host ID from local directory
failed to parse server version:
en: failed to parse server version
failed to parse uuid for local store status:
en: failed to parse uuid for local store status
failed to post records:
en: failed to post records
failed to read upload page:
en: failed to read upload page
file task panicked:
en: file task panicked
got remote index:
en: got remote index
invalid base64:
en: invalid base64
invalid host UUID format in sqlite DB:
en: invalid host UUID format in sqlite DB
invalid id UUID format in sqlite DB:
en: invalid id UUID format in sqlite DB
invalid login details:
en: invalid login details
issue in stats average query:
en: issue in stats average query
issue in stats day of week query:
en: issue in stats day of week query
issue in stats duration over time query:
en: issue in stats duration over time query
issue in stats exits query:
en: issue in stats exits query
issue in stats next query:
en: issue in stats next query
issue in stats previous query:
en: issue in stats previous query
key already exists! cannot overwrite:
en: key already exists! cannot overwrite
key mnemonic was not valid:
en: key mnemonic was not valid
key was not the correct length:
en: key was not the correct length
'kv value too large: max len {len} bytes':
en: 'kv value too large: max len {len} bytes'
listing history:
en: listing history
listing history from %{from} to %{to}:
en: listing history from %{from} to %{to}
loading history item:
en: loading history item
malformed decrypted history:
en: malformed decrypted history
opening sqlite database at %{path}:
en: opening sqlite database at %{path}
operational error:
en: operational error
remote has %{remote_count}, we have %{local_count}:
en: remote has %{remote_count}, we have %{local_count}
running sqlite database setup:
en: running sqlite database setup
saving history to sqlite:
en: saving history to sqlite
set theme debug on for more info:
en: set theme debug on for more info
skipping {id} - already exists:
en: skipping {id} - already exists
something has gone wrong with the sync logic:
en: something has gone wrong with the sync logic
starting sync download:
en: starting sync download
sync downloaded %{num}:
en: sync downloaded %{num}
the local store is ahead of the remote, but for another host. has remote lost data?:
en: 'the local store is ahead of the remote, but for another host. has remote lost data?'
too many entries in v0 kv record:
en: too many entries in v0 kv record
trailing bytes decoding HistoryRecord::Delete - malformed? got %{bytes}:
en: trailing bytes decoding HistoryRecord::Delete - malformed? got %{bytes}
trailing bytes in encoded history. malformed:
en: 'trailing bytes in encoded history. malformed'
trailing bytes in encoded kvrecord. malformed:
en: 'trailing bytes in encoded kvrecord. malformed'
unknown HistoryRecord type %{n}:
en: unknown HistoryRecord type %{n}
unknown history version %{version}:
en: unknown history version %{version}
unknown version:
en: unknown version
unknown version %{version:?}:
en: unknown version %{version:?}
unknown version %{version}:
en: unknown version %{version}
updating sqlite history:
en: updating sqlite history
upload cursor:
en: upload cursor
uploading %{records} records to %{url}:
en: uploading %{records} records to %{url}
username already in use:
en: username already in use
wrapped cek did not contain the correct contents:
en: wrapped cek did not contain the correct contents

16 changes: 16 additions & 0 deletions crates/atuin-client/locales/app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
_version: 2
DIRECTORY:
en: DIRECTORY
ga: COMHADLANN
GLOBAL:
en: GLOBAL
ga: UILÍOCH
HOST:
en: HOST
ga: ÓSTACH
SESSION:
en: SESSION
ga: SEISIÚN
WORKSPACE:
en: WORKSPACE
ga: SPÁS OIBRE
Loading
Loading