Skip to content

Commit

Permalink
added localization
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Oct 2, 2023
1 parent 12df117 commit 713a029
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 75 deletions.
46 changes: 4 additions & 42 deletions app/components/common/header/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,15 @@
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
<span>Avalik portaal</span>
<span><%= t('common.open_portal') %>l</span>
</button>
</div>
<div class="c-toolbar js-toolbar" data-hamburger-target='menu'>
<div class="c-toolbar__grid">
<div class="c-toolbar__nav">
<ul class="s-toolbar-nav">
<li>
<a href="#">Avalik portaal</a>
<ul class="submenu">
<li>
<a href="#">Info</a>
<span class="o-arrow o-arrow--visible-on-desktop js-submenu-toggle"></span>
<ul class="submenu">
<li>
<a href="#">hell</a>
</li>
</ul>
</li>
</ul>
<a href="#"><%= t('common.open_portal') %>l</a>
</li>
<li class="is-active" data-controller='navbar--expandable'>
<a>Oksjonikeskkond</a>
Expand All @@ -36,40 +25,13 @@

</li>
<li>
<a href="#">Registripidaja portaal</a>
<ul class="submenu">
<li>
<ul class="submenu">
<li>
<a href="#">Hello</a>
</li>
</ul>
</li>
</ul>
<a href="#"><%= t('common.registrar_portal') %></a>
</li>
<li>
<a href="#">Registreerija portaal</a>
<ul class="submenu">
<li>
<ul class="submenu">
<li>
<a href="#">Submenu</a>
</li>
</ul>
</li>
</ul>
<a href="#"><%= t('common.registrant_portal') %></a>
</li>
<li>
<a href="#">eeIDc-hero</a>
<ul class="submenu">
<li>
<ul class="submenu">
<li>
<a href="#">Submenu</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/components/common/notifications/icon/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h5 class="c-notification__header__title"><%= t('english_offers.index.you_won') %>! <span class="o-new"></span></h5>
<%- elsif @notification_type == 'OfferNotification' %>
<span class="c-notification__header__icon o-hammer-icon"></span>
<h5 class="c-notification__header__title">OfferNotification <span class="o-new"></span></h5>
<h5 class="c-notification__header__title"><%= t('english_offers.index.new_bid') %> <span class="o-new"></span></h5>
<%- elsif @notification_type == 'AuctionLooserNotification' %>
<span class="c-notification__header__icon o-hammer-icon"></span>
<h5 class="c-notification__header__title"><%= t('english_offers.index.you_lose') %>! <span class="o-new"></span></h5>
Expand All @@ -16,7 +16,7 @@
<h5 class="c-notification__header__title"><%= t('english_offers.index.you_won') %>! <span class="o-new"></span></h5>
<%- elsif @notification_type == 'OfferNotification' %>
<span class="o-hammer-icon"></span>
<h5 class="c-notification__header__title">OfferNotification <span class="o-new"></span></h5>
<h5 class="c-notification__header__title"><%= t('english_offers.index.new_bid') %> <span class="o-new"></span></h5>
<%- elsif @notification_type == 'AuctionLooserNotification' %>
<span class="o-hammer-icon"></span>
<h5 class="c-notification__header__title"><%= t('english_offers.index.you_lose') %>! <span class="o-new"></span></h5>
Expand Down
18 changes: 10 additions & 8 deletions app/components/modals/change_offer_po/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@
<div class="c-modal__header">
<div class="c-modal__header__title">
<span class="o-edit-icon--green"></span>
<span>Muuda pakkumist</span>
<span><%= t('offer.change_bid') %></span>
</div>
<div class="c-modal__header__subject">
<span class="c-modal__header__subject__title"><%= @auction.domain_name %></span>
<span class="o-po-icon o-io-icon--bg-orange"></span>
</div>
<div class="c-modal__header__desc">
<span>Domeeni eelisõiguse registreerimise pakkumine</span>
<span data-tooltip="Domeeni eelisõiguse registreerimise pakkumine."
<span><%= t('offer.new.title') %></span>
<span data-tooltip="<%= t('offer.new.title') %>."
class="o-info-icon js-tippy"></span>
</div>
</div>

<div class="c-modal__main">
<div class="c-modal__grid">
<div class="c-modal__main__info">
<span>Vähim võimalik pakkumus</span>
<span><%= t('english_offers.show.min_bid') %></span>
<h3 class="u-h2 u-m-none"><%= Money.new(Setting.find_by(code: 'auction_minimum_offer').retrieve) %></h3>
</div>
<div class="c-modal__main__info c-modal__main__info--black">
<strong>Hetke parim pakkumus</strong>
<strong><%= t('english_offers.show.current_price') %></strong>
<h3 class="u-h2 u-m-none"><%= current_price %></h3>
<span>S<%= t('auctions.you') %></span>
</div>
Expand All @@ -46,7 +46,9 @@
<span id="offer_<%=offer.auction.id%>_form">
<%= component 'modals/change_offer/number_form_field', offer_value: current_price, offer_disabled: @auction.finished? %>
</span>
<span class="c-modal__input-desc">Pakkumus peab olema vähemalt 5.00</span>
<span class="c-modal__input-desc">
<%= t('.minimum_offer', minimum: Money.new(Setting.find_by(code: 'auction_minimum_offer').retrieve,
Setting.find_by(code: 'auction_currency').retrieve)) %></span>
</div>
<div class="c-modal__col">
<label>Kokku</label>
Expand All @@ -67,13 +69,13 @@
class: billing_profiles.size == 1 ? "disabled" : "",
data: { action: 'change->autotax-counter#updateTax' } %>
</div>
<a class="c-modal__link c-modal__link--first-col" href="#">Uus arve aadress</a>
<a class="c-modal__link c-modal__link--first-col" href="#"><%= t(:new_billing_profile) %></a>
<% end %>

</div>
<div class="c-modal__footer">
<div class="c-modal__footer__col">
<button class="c-btn c-btn--ghost" data-action='modals--offer-modal#close'>Tagasi</button>
<button class="c-btn c-btn--ghost" data-action='modals--offer-modal#close'><%= t('close') %></button>
</div>

<% if @auction.in_progress? %>
Expand Down
20 changes: 0 additions & 20 deletions app/models/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class Invoice < ApplicationRecord
delegate :enable_deposit?, to: :enable_deposit?
delegate :deposit, to: :deposit

attr_accessor :vat_rate

scope :with_search_scope, (lambda do |origin|
if origin.present?
if numeric?(origin)
Expand Down Expand Up @@ -79,27 +77,9 @@ def self.search(params = {})

case params[:sort]
when 'channel'
# invoices_array = query.to_a

# if sort_direction == 'asc'
# invoices_array.sort_by do |invoice|
# invoice.paid_with_payment_order&.channel || ''
# end
# else
# invoices_array.sort_by do |invoice|
# invoice.paid_with_payment_order&.channel || ''
# end.reverse
# end

query.left_outer_joins(:paid_with_payment_order)
.select("invoices.*, REPLACE(payment_orders.type, 'PaymentOrders::', '') AS payment_order_channel")
.order(Arel.sql("payment_order_channel #{sort_direction} NULLS LAST"))

# query.left_outer_joins(:paid_with_payment_order)
# .select("invoices.*, COALESCE(REPLACE(paid_with_payment_orders.type, 'PaymentOrders::', ''), '') AS payment_order_channel")
# .order(Arel.sql("payment_order_channel #{sort_direction} NULLS LAST"))


when 'billing_profile_name'
query.left_outer_joins(:billing_profile).order("billing_profiles.name #{sort_direction}")
when 'total'
Expand Down
4 changes: 2 additions & 2 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
</div>
<div class="c-login__links u-flex u-align-center u-content-sp">
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<%= link_to t('devise.shared.links.forgot_your_password'), new_password_path(resource_name), class: 'c-login__remind-link', data: { turbo_frame: 'modal' } %><br />
<%= link_to t('devise.shared.links.forgot_your_password'), new_password_path(resource_name), class: 'c-btn c-login__remind-link js-modal-toggle-fp', data: { turbo_frame: 'modal' } %><br />
<% end -%>

<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to t('devise.shared.links.didnt_receive_confirmation_instructions'), new_confirmation_path(resource_name), class: 'c-login__remind-link', data: { turbo_frame: 'modal' } %><br />
<%= link_to t('devise.shared.links.didnt_receive_confirmation_instructions'), new_confirmation_path(resource_name), class: 'c-login__remind-link js-modal-toggle', data: { turbo_frame: 'modal' } %><br />
<% end -%>
</div>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions config/locales/common.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ en:
open_portal: "Public portal"
auction_portal: "Auction portal"
registrar_portal_url_html: '<a href= "https://www.internet.ee/registrar-portal"><span>Registrar portal</span></a>'
registrar_portal: "Registrar portal"
registrant_portal: "Registrant portal"
notifications: "Notifications"

Expand Down
2 changes: 1 addition & 1 deletion config/locales/common.et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ et:
open_portal: "Avalik portaal"
auction_portal: "Oksjonikeskkond"
registrar_portal_url_html: '<a href= "https://www.internet.ee/registripidaja"><span>Registripidaja portaal</span></a>'

registrar_portal: "Registripidaja portaal"
registrant_portal: "Registreerija portaal"
notifications: "Teavitused"

Expand Down
1 change: 1 addition & 0 deletions config/locales/english_offers.ee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ et:
Domeeninimele võib olla ka teisi pakkujaid.
Tee pakkumine vastavalt oma hinnangule domeeninime väärtuse kohta.
timer: Oksjoni lõpuni on jäänud
new_bid: "Uus pakkumus"

new:
title: "Domeeni registreerimise eelisõiguse pakkumus"
Expand Down
1 change: 1 addition & 0 deletions config/locales/english_offers.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ en:
There might be other bids.
Make an offer according to the value the domain name holds to you.
timer: Auction will finish in
new_bid: "New bid"

new:
title: "Offer for the reservation of the domain name"
Expand Down

0 comments on commit 713a029

Please sign in to comment.