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

Send periodic OC bot messages to translators #5319

Merged
merged 8 commits into from
Feb 5, 2024
Merged
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
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/canister_installer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ async fn install_service_canisters_impl(
escrow_canister_id: canister_ids.escrow,
nns_governance_canister_id: canister_ids.nns_governance,
internet_identity_canister_id: canister_ids.nns_internet_identity,
translations_canister_id: canister_ids.translations,
wasm_version: version,
test_mode,
};
Expand Down
10 changes: 10 additions & 0 deletions backend/canisters/translations/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Added

- Implement translations API ([#5299](https://github.com/open-chat-labs/open-chat/pull/5299))
- Send periodic OC bot messages to translators ([#5318](https://github.com/open-chat-labs/open-chat/pull/5318))

### Changed

- Only pay user once for translating a given record ([#5312](https://github.com/open-chat-labs/open-chat/pull/5312))
- Simplify translations impl ([#5315](https://github.com/open-chat-labs/open-chat/pull/5315))
6 changes: 6 additions & 0 deletions backend/canisters/translations/api/can.did
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ type ApproveResponse = variant {

type RejectArgs = record {
id : nat64;
reason : RejectReason;
};

type RejectReason = variant {
TooLong;
IncorrectMeaning;
};

type RejectResponse = variant {
Expand Down
7 changes: 7 additions & 0 deletions backend/canisters/translations/api/src/updates/reject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
#[derive(CandidType, Serialize, Deserialize, Debug)]
pub struct Args {
pub id: u64,
pub reason: RejectReason,
}

#[derive(CandidType, Serialize, Deserialize, Debug)]
Expand All @@ -14,3 +15,9 @@ pub enum Response {
NotAuthorized,
InternalError(String),
}

#[derive(CandidType, Serialize, Deserialize, Debug)]
pub enum RejectReason {
TooLong,
IncorrectMeaning,
}
3 changes: 3 additions & 0 deletions backend/canisters/translations/impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ canister_api_macros = { path = "../../../libraries/canister_api_macros" }
canister_logger = { path = "../../../libraries/canister_logger" }
canister_state_macros = { path = "../../../libraries/canister_state_macros" }
canister_tracing_macros = { path = "../../../libraries/canister_tracing_macros" }
fire_and_forget_handler = { path = "../../../libraries/fire_and_forget_handler" }
http_request = { path = "../../../libraries/http_request" }
ic-cdk = { workspace = true }
ic-cdk-macros = { workspace = true }
Expand All @@ -23,6 +24,8 @@ ic-stable-structures = { workspace = true }
icrc_ledger_canister = { path = "../../../external_canisters/icrc_ledger/api" }
icrc_ledger_canister_c2c_client = { path = "../../../external_canisters/icrc_ledger/c2c_client" }
icrc-ledger-types = { workspace = true }
itertools = { workspace = true }
msgpack = { path = "../../../libraries/msgpack" }
rand = { workspace = true }
serde = { workspace = true }
serializer = { path = "../../../libraries/serializer" }
Expand Down
5 changes: 5 additions & 0 deletions backend/canisters/translations/impl/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use candid::Principal;
use canister_state_macros::canister_state;
use fire_and_forget_handler::FireAndForgetHandler;
use model::{pending_payments_queue::PendingPaymentsQueue, translations::Translations};
use serde::{Deserialize, Serialize};
use std::cell::RefCell;
Expand Down Expand Up @@ -58,6 +59,8 @@ struct Data {
pub rng_seed: [u8; 32],
pub translations: Translations,
pub pending_payments_queue: PendingPaymentsQueue,
pub fire_and_forget_handler: FireAndForgetHandler,
pub user_notifications_last_sent: TimestampMillis,
pub test_mode: bool,
}

Expand All @@ -75,6 +78,8 @@ impl Data {
rng_seed: [0; 32],
translations: Translations::default(),
pending_payments_queue: PendingPaymentsQueue::default(),
fire_and_forget_handler: FireAndForgetHandler::default(),
user_notifications_last_sent: 0,
test_mode,
}
}
Expand Down
Loading
Loading