|
1 | 1 | <script setup lang="ts"> |
2 | 2 | import { onMounted, ref, Ref, computed, ComputedRef } from "vue"; |
3 | 3 |
|
| 4 | + import { useI18n } from "vue-i18n"; |
| 5 | + const { t } = useI18n({ useScope: "global" }); |
| 6 | +
|
4 | 7 | import { PForm, PFormItem, PFormSeperator, PButton, PInput } from "@/ui"; |
5 | 8 | import { IUserRegistrationPayload } from "@/features/api/userData.types"; |
6 | 9 | import { useQuery } from "@/lib/query_cache/useQuery"; |
|
102 | 105 | <template v-if="registrationSuccess"> |
103 | 106 | <div> |
104 | 107 | <div class="text-xl text-white font-bold font-mono pb-1"> |
105 | | - Welcome, {{ registrationUsername }}! |
| 108 | + {{ |
| 109 | + $t("account.components.registration.result.ok_header", { |
| 110 | + username: registrationUsername, |
| 111 | + }) |
| 112 | + }} |
106 | 113 | </div> |
107 | 114 | <div class="pt-3"> |
108 | | - Registration successful. You can now login to PRUNplanner. |
| 115 | + {{ |
| 116 | + $t("account.components.registration.result.ok_message") |
| 117 | + }} |
109 | 118 | </div> |
110 | 119 | </div> |
111 | 120 | </template> |
112 | 121 | <template v-else> |
113 | 122 | <div class="text-xl text-white font-bold font-mono pb-1"> |
114 | | - Account Information |
| 123 | + {{ $t("account.components.registration.title") }} |
115 | 124 | </div> |
116 | 125 | <div class="pb-3 text-white/60 text-xs font-mono"> |
117 | | - PRUNplanner is free to use. By creating an account, you |
118 | | - acknowledge and agree to the |
119 | | - <router-link |
120 | | - to="/imprint-tos" |
121 | | - class="underline hover:text-link-primary"> |
122 | | - Terms of Service. |
123 | | - </router-link> |
| 126 | + <i18n-t keypath="account.components.registration.tos" tag="p"> |
| 127 | + <template #tos_link> |
| 128 | + <router-link |
| 129 | + to="/imprint-tos" |
| 130 | + class="hover:cursor-pointer underline"> |
| 131 | + {{ $t("account.components.registration.tos_link") }} |
| 132 | + </router-link> |
| 133 | + </template> |
| 134 | + </i18n-t> |
124 | 135 | </div> |
125 | 136 | <div v-if="hasError" class="pb-3 text-red-600"> |
126 | | - Error during registration. |
| 137 | + {{ $t("account.components.registration.result.error") }} |
| 138 | + <br /> |
127 | 139 | {{ hasErrorMessage }} |
128 | 140 | </div> |
129 | 141 | <PForm> |
130 | | - <PFormItem label="Username"> |
| 142 | + <PFormItem |
| 143 | + :label="t('account.components.registration.form.username')"> |
131 | 144 | <PInput v-model:value="inputUsername" class="w-full" /> |
132 | 145 | <template #info> |
133 | | - Must be at least 3 characters long. Can't contain |
134 | | - spaces. |
| 146 | + {{ |
| 147 | + $t( |
| 148 | + "account.components.registration.form.username_info" |
| 149 | + ) |
| 150 | + }} |
135 | 151 | </template> |
136 | 152 | </PFormItem> |
137 | | - <PFormItem label="Password"> |
| 153 | + <PFormItem |
| 154 | + :label="t('account.components.registration.form.password')"> |
138 | 155 | <PInput |
139 | 156 | v-model:value="inputPassword" |
140 | 157 | type="password" |
141 | 158 | class="w-full" /> |
142 | 159 | <template #info> |
143 | | - Must be at least 8 characters long. |
| 160 | + {{ |
| 161 | + $t( |
| 162 | + "account.components.registration.form.password_info" |
| 163 | + ) |
| 164 | + }} |
144 | 165 | </template> |
145 | 166 | </PFormItem> |
146 | | - <PFormItem label="Email"> |
| 167 | + <PFormItem |
| 168 | + :label="t('account.components.registration.form.email')"> |
147 | 169 | <PInput |
148 | 170 | v-model:value="inputEmail" |
149 | | - placeholder="Not mandatory, but recommended." |
| 171 | + :placeholder=" |
| 172 | + t( |
| 173 | + 'account.components.registration.form.email_placeholder' |
| 174 | + ) |
| 175 | + " |
150 | 176 | class="w-full" /> |
151 | 177 | <template #info> |
152 | | - Not mandatory. Increases your account security. |
| 178 | + {{ |
| 179 | + $t( |
| 180 | + "account.components.registration.form.email_info" |
| 181 | + ) |
| 182 | + }} |
153 | 183 | </template> |
154 | 184 | </PFormItem> |
155 | 185 | <PFormSeperator> |
156 | 186 | <div |
157 | 187 | class="text-xl text-white font-bold font-mono pt-3 pb-1"> |
158 | | - Security Question |
| 188 | + {{ |
| 189 | + $t( |
| 190 | + "account.components.registration.form.security_question" |
| 191 | + ) |
| 192 | + }} |
159 | 193 | </div> |
160 | 194 | <div class="font-mono text-xs text-white/60 pb-3"> |
161 | | - Enter the name of planet |
162 | | - <span |
163 | | - class="text-nowrap bg-prunplanner text-black px-1" |
164 | | - >{{ activeSecurityOption }}</span |
165 | | - >. To find it, open a new Prosperous Universe buffer |
166 | | - with the command |
167 | | - <span |
168 | | - class="text-nowrap bg-prunplanner text-black px-0.5" |
169 | | - >{{ `PLI ${activeSecurityOption}` }}</span |
170 | | - >. You'll see the planet's name listed under "Name" in |
171 | | - the planet information. |
| 195 | + <i18n-t |
| 196 | + keypath="account.components.registration.form.question" |
| 197 | + tag="p"> |
| 198 | + <template #planet> |
| 199 | + <span |
| 200 | + class="text-nowrap bg-prunplanner text-black px-1" |
| 201 | + >{{ activeSecurityOption }}</span |
| 202 | + > |
| 203 | + </template> |
| 204 | + <template #command> |
| 205 | + <span |
| 206 | + class="text-nowrap bg-prunplanner text-black px-0.5" |
| 207 | + >{{ `PLI ${activeSecurityOption}` }}</span |
| 208 | + > |
| 209 | + </template> |
| 210 | + </i18n-t> |
172 | 211 | </div> |
173 | 212 | </PFormSeperator> |
174 | | - <PFormItem label="Name"> |
| 213 | + <PFormItem |
| 214 | + :label=" |
| 215 | + t('account.components.registration.form.planet_name') |
| 216 | + "> |
175 | 217 | <PInput v-model:value="inputPlanetName" class="w-full" /> |
176 | 218 | </PFormItem> |
177 | 219 | <PFormItem label=""> |
|
180 | 222 | :loading="isLoading" |
181 | 223 | class="mt-3" |
182 | 224 | @click="registerUser"> |
183 | | - Create Account |
| 225 | + {{ |
| 226 | + $t( |
| 227 | + "account.components.registration.buttons.register" |
| 228 | + ) |
| 229 | + }} |
184 | 230 | </PButton> |
185 | 231 | </PFormItem> |
186 | 232 | </PForm> |
|
0 commit comments