浏览代码

subscription translation: add name formatting and currency formatting

Olivier Massot 4 年之前
父节点
当前提交
5037a4d5b9
共有 2 个文件被更改,包括 60 次插入52 次删除
  1. 11 10
      lang/content/subscription/fr-FR.js
  2. 49 42
      pages/subscription.vue

+ 11 - 10
lang/content/subscription/fr-FR.js

@@ -8,16 +8,16 @@
 export default (context, locale) => {
   return ({
     get_more_functionalities_with_version: 'Bénéficiez de plus de fonctionnalités avec la version',
-    for_only_x_eur_ttc_by_month: 'Pour seulement { price } TTC par mois',
-    yearly_paid_giving_x_eur_ttc_per_year: 'Payable annuellement, soit { price } €.TTC / an',
+    for_only_x_eur_ttc_by_month: 'Pour seulement {price} TTC par mois',
+    yearly_paid_giving_x_eur_ttc_per_year: 'Payable annuellement, soit {price} TTC / an',
     only_for_cmf_members: 'Offre réservée aux adhérents CMF',
-    public_price_x_ttc_a_year: 'Prix public: { price } €.TTC/an',
+    public_price_x_ttc_a_year: 'Prix public: {price} TTC/an',
     product_sheet: 'Fiche produit',
     download_order_form: 'Télécharger le bon de commande',
     download_cmf_order_form: 'Télécharger le bon de commande CMF',
     a_suitable_solution_for_your_artistic_school: 'Une solution économique adaptée à votre établissement d\'enseignement artistique',
-    starting_from_x_eur_ttc_per_month: 'A partir de { price } TTC par mois',
-    version_x_up_to_x_students: 'Version <b>{ product }</b> jusqu\'à { max_students } students',
+    starting_from_x_eur_ttc_per_month: 'A partir de {price} TTC par mois',
+    version_x_up_to_x_students: 'Version {product} jusqu\'à {max_students} students',
     excluding_license_and_training_fees: 'Hors frais de licence d\'utilisation et de formation',
     freely_try_our_software: 'Essayez notre logiciel en toute liberté',
     contact_us_for_show_and_demo: 'Contactez-nous sans plus tarder pour obtenir une présentation ainsi qu\'un accès de démonstration',
@@ -27,14 +27,15 @@ export default (context, locale) => {
     and_benefit: 'et bénéficiez',
     of_accounts_for_teachers_and_students: 'de comptes pour vos professeurs et élèves',
     of_a_complete_website: 'd\'un site internet complet',
-    send_sms_from_app_to_your_members: 'Envoyez des <b>SMS</b> directement depuis votre logiciel à vos membres / élèves',
-    starting_from_x_eur_ttc_per_ssm: 'A partir de { price } TTC / sms',
-    for_x_sms: 'pour { amount } SMS',
-    get_your_own_domain_and_up_to_five_emails_for_only_x_eur_ttc_per_month: 'Bénéficiez de votre <b>propre nom de domaine</b> et 5 adresses email pour seulement { price } €.TTC / mois',
+    send_sms_from_app_to_your_members: 'Envoyez des SMS directement depuis votre logiciel à vos membres / élèves',
+    starting_from_x_eur_ttc_per_ssm: 'A partir de {price} TTC / sms',
+    for_x_sms: 'pour {amount} SMS',
+    "get_your_own_domain_and_up_to_five_emails_for_only_x_eur_ttc_per_month": "Bénéficiez de votre propre nom de domaine et 5 adresses email pour seulement {price} TTC / mois",
     example: 'Exemple',
     domain_name: 'Nom de domaine',
     dummy_domain_name: 'ma-structure.fr',
     associated_mail_address: 'Adresse email associée',
-    dummy_email_address: 'contact@ma-structure.fr'
+    dummy_email_address: 'contact@ma-structure.fr',
+    sms: 'SMS'
   })
 }

+ 49 - 42
pages/subscription.vue

@@ -10,7 +10,7 @@ Page 'Mon abonnement'
         {{ $t('my_subscription') }}
       </h3>
 
-      <v-expansion-panels focusable multiple :value="[0,1]">
+      <v-expansion-panels focusable multiple :value="[0,1,2]">
         <UiExpansionPanel id="informations" icon="fa-info">
           <v-container fluid class="container">
             <v-row>
@@ -93,16 +93,16 @@ Page 'Mon abonnement'
                   <thead>
                     <tr>
                       <th v-if="organizationProfile.isArtistProduct">
-                        Opentalent Artist Premium
+                        {{ $t('PRODUCT_ARTIST_PREMIUM') }}
                       </th>
                       <th v-if="organizationProfile.isArtist">
-                        Opentalent School
+                        {{ $t('PRODUCT_SCHOOL') }}
                       </th>
                       <th v-if="organizationProfile.isSchoolProduct">
-                        Opentalent School Premium
+                        {{ $t('PRODUCT_SCHOOL_PREMIUM') }}
                       </th>
                       <th>
-                        Sms
+                        {{ $t('sms') }}
                       </th>
                       <th>
                         {{ $t('website') }}
@@ -131,48 +131,48 @@ Page 'Mon abonnement'
                       <!-- Opentalent Artist Premium -->
                       <td v-if="organizationProfile.isArtistProduct">
                         <p>
-                          {{ $t('get_more_functionalities_with_version') }} <b>Opentalent Artist Premium</b>
+                          {{ $t('get_more_functionalities_with_version') }} <b>{{ $t('PRODUCT_ARTIST_PREMIUM') }}</b>
                         </p>
 
                         <!-- Cmf member -->
                         <div v-if="organizationProfile.isCmf">
                           <p>
-                            {{ $t('for_only_x_eur_ttc_by_month', { price: '6.33' }) }} *
+                            <b>{{ $t('for_only_x_eur_ttc_by_month', { price: formatCurrency(7.25, 'EUR') }) }} *</b>
                           </p>
                           <p>
                             <i>
-                              * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '76' }) }}
-                              {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: '168' }) }})
+                              * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(87.00, 'EUR') }) }}
+                              {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: formatCurrency(168.00, 'EUR') }) }})
                             </i>
                           </p>
                         </div>
 
-                        <!-- Not cmf member -->
+                        <!-- Not a cmf member -->
                         <div v-else>
                           <p>
-                            {{ $t('for_only_x_eur_ttc_by_month', { price: '14' }) }} *
+                            <b>{{ $t('for_only_x_eur_ttc_by_month', { price: formatCurrency(14.00, 'EUR') }) }} *</b>
                           </p>
                           <p>
                             <i>
-                              * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '168' }) }}
+                              * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(168.00, 'EUR') }) }}
                             </i>
                           </p>
                         </div>
 
                         <p>
                           <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentartist.pdf">
-                            {{ $t('product_sheet') }} Opentalent Artist Premium
+                            {{ $t('product_sheet') }} : {{ $t('PRODUCT_ARTIST_PREMIUM') }}
                           </a>
                         </p>
 
                         <p v-if="organizationProfile.isCmf">
                           <a href="">
-                            {{ $t('download_cmf_order_form') }}
+                            <b>{{ $t('download_cmf_order_form') }}</b>
                           </a>
                         </p>
                         <p v-else>
                           <a href="">
-                            {{ $t('download_order_form') }}
+                            <b>{{ $t('download_order_form') }}</b>
                           </a>
                         </p>
                       </td>
@@ -185,22 +185,22 @@ Page 'Mon abonnement'
 
                         <!-- Cmf member -->
                         <div v-if="organizationProfile.isCmf">
-                          <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: '16.45' }) }} *</p>
+                          <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: formatCurrency(16.45, 'EUR') }) }} *</p>
                           <p>
                             <i>
-                              * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '198' }) }}
+                              * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(198, 'EUR') }) }}
                               {{ $t('version_x_up_to_x_students', { product: 'Opentalent School Standard', max_students: '69' }) }}
                               {{ $t('excluding_license_and_training_fees') }}.
-                              {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: '358.80' }) }})
+                              {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: formatCurrency(358.80, 'EUR') }) }})
                             </i>
                           </p>
                         </div>
                         <!-- Not a cmf member -->
                         <div v-else>
-                          <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: '29.90' }) }} *</p>
+                          <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: formatCurrency(29.90, 'EUR') }) }} *</p>
                           <p>
                             <i>
-                              * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '358' }) }}
+                              * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(358, 'EUR') }) }}
                               {{ $t('version_x_up_to_x_students', { product: 'Opentalent School Standard', max_students: '69' }) }}
                               {{ $t('excluding_license_and_training_fees') }}.
                             </i>
@@ -226,7 +226,7 @@ Page 'Mon abonnement'
                       <!-- Opentalent School Premium -->
                       <td v-if="organizationProfile.isSchoolProduct">
                         <p>
-                          {{ $t('switch_to_version') }} <b>Opentalent School Premium</b> {{ $t('and_benefit') }}:
+                          {{ $t('switch_to_version') }} <b>{{ $t('PRODUCT_SCHOOL_PREMIUM') }}</b> {{ $t('and_benefit') }} :
                         </p>
 
                         <ul>
@@ -236,23 +236,23 @@ Page 'Mon abonnement'
 
                         <!-- Cmf member -->
                         <div v-if="organizationProfile.isCmf">
-                          <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: '22,30' }) }} *</p>
+                          <p><b>{{ $t('starting_from_x_eur_ttc_per_month', { price: formatCurrency(26.50, 'EUR') }) }} *</b></p>
                           <p>
                             <i>
-                              * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '267,60' }) }}
-                              {{ $t('version_x_up_to_x_students', { product: 'Opentalent School Premium', max_students: '69' }) }}
+                              * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(318.00, 'EUR') }) }}
+                              {{ $t('version_x_up_to_x_students', { product: $t('PRODUCT_SCHOOL_PREMIUM'), max_students: '69' }) }}
                               {{ $t('excluding_license_and_training_fees') }}.
-                              {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: '438' }) }})
+                              {{ $t('only_for_cmf_members') }} ({{ $t('public_price_x_ttc_a_year', { price: formatCurrency(529.20, 'EUR') }) }})
                             </i>
                           </p>
                         </div>
                         <!-- Not cmf member -->
                         <div v-else>
-                          <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: '36,50' }) }} *</p>
+                          <p>{{ $t('starting_from_x_eur_ttc_per_month', { price: formatCurrency(44.10, 'EUR') }) }} *</p>
                           <p>
                             <i>
-                              * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: '438' }) }}
-                              {{ $t('version_x_up_to_x_students', { product: 'Opentalent School Premium', max_students: '69' }) }}
+                              * {{ $t('yearly_paid_giving_x_eur_ttc_per_year', { price: formatCurrency(529.20, 'EUR') }) }}
+                              {{ $t('version_x_up_to_x_students', { product: $t('PRODUCT_SCHOOL_PREMIUM'), max_students: '69' }) }}
                               {{ $t('excluding_license_and_training_fees') }}.
                             </i>
                           </p>
@@ -260,7 +260,7 @@ Page 'Mon abonnement'
 
                         <p>
                           <a href="https://www.opentalent.fr/uploads/opentalent/ficheproduit_Opentalentschool">
-                            {{ $t('product_sheet') }} Opentalent School
+                            {{ $t('product_sheet') }} {{ $t('PRODUCT_SCHOOL') }}
                           </a>
                         </p>
 
@@ -272,38 +272,41 @@ Page 'Mon abonnement'
 
                       <!-- SMS -->
                       <td>
-                        <p>{{ $t('send_sms_from_app_to_your_members') }}</p>
+                        <p><b>{{ $t('send_sms_from_app_to_your_members') }}</b></p>
 
                         <!-- Cmf member -->
                         <div v-if="organizationProfile.isCmf">
-                          <p>{{ $t('starting_from_x_eur_ttc_per_sms', { price: '0.10' }) }} *</p>
+                          <p><b>{{ $t('starting_from_x_eur_ttc_per_sms', { price: formatCurrency(0.10, 'EUR') }) }} *</b></p>
                           <p><i>* {{ $t('for_x_sms', { amount: '5000' }) }}</i></p>
 
                           <p>
-                            <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-CMF.pdf">
-                              {{ $t('download_cmf_order_form') }}
-                            </a>
+                            <b>
+                              <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-CMF.pdf">
+                                {{ $t('download_cmf_order_form') }}
+                              </a>
+                            </b>
                           </p>
                         </div>
                         <!-- Not cmf member -->
                         <div v-else>
-                          <p>{{ $t('starting_from_x_eur_ttc_per_sms', { price: '0.12' }) }} *</p>
+                          <p><b>{{ $t('starting_from_x_eur_ttc_per_ssm', { price: formatCurrency(0.12, 'EUR') }) }} *</b></p>
                           <p><i>* {{ $t('for_x_sms', { amount: '5000' }) }}</i></p>
 
                           <p>
-                            <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-public.pdf">
-                              {{ $t('download_order_form') }}
-                            </a>
+                            <b>
+                              <a href="https://www.opentalent.fr/uploads/opentalent/Bon_commande_SMS_ouverture-public.pdf">
+                                {{ $t('download_order_form') }}
+                              </a>
+                            </b>
                           </p>
                         </div>
                       </td>
 
                       <!-- Custom domain -->
                       <td>
-                        <p>
-                          {{ $t('get_your_own_domain_and_up_to_five_emails_for_only_x_eur_ttc_per_month', { price: '34,80' }) }}
-                        </p>
+                        <b>{{ $t('get_your_own_domain_and_up_to_five_emails_for_only_x_eur_ttc_per_month', { price: formatCurrency(34.80, 'EUR') }) }}</b>
 
+                        <br/>
                         <p>{{ $t('example') }} :</p>
                         <table>
                           <tr>
@@ -367,6 +370,11 @@ export default defineComponent({
       dolibarrAccount,
       dolibarrAccountFetch: fetchState
     }
+  },
+  methods: {
+    formatCurrency(value: Number, currency: string): string {
+      return value.toLocaleString(this.$i18n.locale, { style: 'currency', currency: currency })
+    }
   }
 })
 </script>
@@ -390,5 +398,4 @@ export default defineComponent({
     padding: 12px 18px;
     vertical-align: top;
   }
-
 </style>