Skip to content

Commit

Permalink
Merge pull request #417 from ZIMkaRU/feature/add-logic-to-have-separa…
Browse files Browse the repository at this point in the history
…ted-trans-by-langs

Add logic to have separated translations by language
  • Loading branch information
ezewer authored Sep 23, 2024
2 parents 2cc4032 + a07923b commit 3643af6
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 94 deletions.
14 changes: 14 additions & 0 deletions locales/en/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "Starting positions snapshot",
"endingPositionsSnapshot": "Ending positions snapshot",
"finalState": "Final state",
"startingPeriodBalances": "Starting period balances",
"movementsDetails": "Movements details",
"endingPeriodBalances": "Ending period balances",
"positions": "Positions",
"wallets": "Wallets",
"positionsTickers": "Positions tickers",
"walletsTickers": "Wallets tickers"
}
}
14 changes: 14 additions & 0 deletions locales/es-EM/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "Captura de las posiciones iniciales",
"endingPositionsSnapshot": "Captura de las posiciones finales",
"finalState": "Estado final",
"startingPeriodBalances": "Balances al inicio del periodo",
"movementsDetails": "Detalles de Movimientos",
"endingPeriodBalances": "Balances al final del periodo",
"positions": "Posiciones",
"wallets": "Carteras",
"positionsTickers": "cotizaciones de las Posiciones",
"walletsTickers": "cotizaciones de las Carteras"
}
}
14 changes: 14 additions & 0 deletions locales/pt-BR/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "Captura das posições iniciais",
"endingPositionsSnapshot": "Captura das posições finais",
"finalState": "Estado final",
"startingPeriodBalances": "Saldos no início do período",
"movementsDetails": "Detalhes das movimentações",
"endingPeriodBalances": "Saldos no final do período",
"positions": "Posições",
"wallets": "Carteiras",
"positionsTickers": "cotações das posições",
"walletsTickers": "cotações das Carteiras"
}
}
14 changes: 14 additions & 0 deletions locales/ru/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "Снимок стартовых позиций",
"endingPositionsSnapshot": "Снимок конечных позиций",
"finalState": "Конечное состояние",
"startingPeriodBalances": "Остатки на начало периода",
"movementsDetails": "Детали движений",
"endingPeriodBalances": "Остатки на конец периода",
"positions": "Позиции",
"wallets": "Кошельки",
"positionsTickers": "Тикеры позиций",
"walletsTickers": "Тикеры кошельков"
}
}
14 changes: 14 additions & 0 deletions locales/tr/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "Pozisyonların Başlangıç Anlık Görüntüsü",
"endingPositionsSnapshot": "Pozisyonların Bitiş Anlık Görüntüsü",
"finalState": "Son Durum",
"startingPeriodBalances": "Başlangıç ​​Dönemi Bakiyeleri",
"movementsDetails": "Hareket Detayları",
"endingPeriodBalances": "Bitiş Dönemi Bakiyeleri",
"positions": "Poziyonlar",
"wallets": "Cüzdanlar",
"positionsTickers": "Pozisyon Tickerları",
"walletsTickers": "Cüzdan Tickerları"
}
}
14 changes: 14 additions & 0 deletions locales/zh-CN/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "仓位期初快照",
"endingPositionsSnapshot": "仓位期末快照",
"finalState": "最后状态",
"startingPeriodBalances": "期初余额",
"movementsDetails": "资金流向明细",
"endingPeriodBalances": "期末余额",
"positions": "仓位",
"wallets": "钱包",
"positionsTickers": "仓位牌价",
"walletsTickers": "钱包牌价"
}
}
14 changes: 14 additions & 0 deletions locales/zh-TW/pdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"template": {
"startingPositionsSnapshot": "倉位期初快照",
"endingPositionsSnapshot": "倉位期末快照",
"finalState": "最終狀態",
"startingPeriodBalances": "期初餘額",
"movementsDetails": "資金流向明細",
"endingPeriodBalances": "期末餘額",
"positions": "倉位",
"wallets": "錢包",
"positionsTickers": "倉位牌價",
"walletsTickers": "錢包牌價"
}
}
1 change: 1 addition & 0 deletions workers/api.framework.report.wrk.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class WrkReportFrameWorkApi extends WrkReportServiceApi {

init () {
super.init()
this.addTransLocation(path.join(__dirname, '../locales'))

this.conf[this.group].dbPathAbsolute = path.isAbsolute(argv.dbFolder)
? argv.dbFolder
Expand Down
8 changes: 4 additions & 4 deletions workers/loc.api/generate-report-file/pdf-writer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@ const depsTypes = (TYPES) => [
TYPES.ROOT_FOLDER_PATH,
TYPES.HasGrcService,
TYPES.GrcBfxReq,
TYPES.I18next,
TYPES.ProcessMessageManager
]
class PdfWriter extends MainPdfWriter {
constructor (
rootFolderPath,
hasGrcService,
grcBfxReq,
i18next,
processMessageManager
) {
super(
rootFolderPath,
hasGrcService,
grcBfxReq
grcBfxReq,
i18next
)

this.processMessageManager = processMessageManager

this.isElectronjsEnv = argv.isElectronjsEnv

this.addTranslations(this.loadTranslations(
path.join(__dirname, 'translations.yml')
))
this.addTemplates({
fileNames: TEMPLATE_FILE_NAMES,
templateFolderPath: path.join(__dirname, 'templates')
Expand Down
90 changes: 0 additions & 90 deletions workers/loc.api/generate-report-file/pdf-writer/translations.yml

This file was deleted.

0 comments on commit 3643af6

Please sign in to comment.