Skip to content

Commit

Permalink
Change serbian currency format loading from gol
Browse files Browse the repository at this point in the history
  • Loading branch information
buresmi7 committed Jan 18, 2024
1 parent 15099ab commit 18a0753
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions app/client/src/utils/createAppConfigFromFe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export const createAppConfigFromFe = (doc: Document, url: string): AppConfig | u
.item(0)
?.textContent?.trim()
.replace('Kč', 'CZK')
.replace(',00', '') // for SR language is different format of price e.g. 7.125,00
.replace('.', ' ')

if (!lowestPrice) {
console.log('Flight watchdog error', 'Price not found.')
Expand Down
2 changes: 1 addition & 1 deletion app/shared/src/translation/srTranslation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const srTranslation: TranslationKeys = {
ClientMessageMinimalizedWindow: `Tražite jeftiniji let? Kliknite ovde.`,
ClientInputEmailPlaceholder: `unesite Vašu e-poštu.`,
ClientTitle: `Pratite cenu {?}?`,
ClientDestinationsReturn: `od{_}{?} do{_}{?} i {_}nazad`,
ClientDestinationsReturn: `od{_}{?} do{_}{?} i{_}nazad`,
ClientDestinationsOneway: `od{_}{?} do{_}{?}`,
ClientDescription: `Pratićemo to za Vas! I svaki dan ćete dobijati novosti. `,
ClientDatesReturn: `{?} do {?}`,
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/client/changeLanguage.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ describe('Change language', function () {

it('sr', function () {
cy.visit(golUrlReturn)
setOptions({ lang: 'sr' })
cy.contains('Pratite cenu 2.000,00 CZK?')
setOptions({ lang: 'sr', price: '7.125,00 RSD' })
cy.contains('Pratite cenu 7.125,00 RSD?')
cy.contains('Prague')
cy.contains('London')
cy.get('.content input').type('[email protected]')
Expand Down
7 changes: 3 additions & 4 deletions tests-utils/httpPages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
document.getElementsByClassName('header-menu-languages-selected')[0].textContent = document.getElementById('option-lang').value.toUpperCase()
document.getElementsByClassName('flight-prices-links-price')[0]
.getElementsByTagName('strong')[0]
.getElementsByTagName('span')[0]
.getElementsByTagName('span')[0] = document.getElementById('option-price').value
.getElementsByTagName('span')[0].textContent = document.getElementById('option-price').value

var settings = {
token: document.getElementById('option-token').value,
Expand All @@ -36,7 +35,7 @@ <h1>Testing page</h1>
<div class="flight">
<div>
<div class="flight-prices-links">
<div class="flight-prices-links-price"><strong><span>2 000 </span></strong></div>
<div class="flight-prices-links-price"><strong><span>2 000 CZK</span></strong></div>
</div>
</div>
</div>
Expand All @@ -59,7 +58,7 @@ <h1>Testing page</h1>
<option value="ERROR">ERROR</option>
</select><br/>
apiUrl: <input name="apiUrl" value="http://localhost:3000" id="option-apiUrl"><br/>
price: <input name="token" value="2 000 CZK" id="option-price"><br/>
price: <input name="price" value="2 000 CZK" id="option-price"><br/>
defaultPrice (not work yet!): <input name="token" value="2 000 CZK" id="option-defaultPrice"><br/>
language: <input name="lang" value="cs" id="option-lang"><br/>
token: <input name="token" value="token" id="option-token"><br/>
Expand Down

0 comments on commit 18a0753

Please sign in to comment.