i18n: undefined (sv-SE) translation
I’ve completed the undefined language translation.
// Please copy and paste the file your just downloaded here
import { FormKitValidationMessages } from '@formkit/validation'
/**
- Here we can import additional helper functions to assist in formatting our
- language. Feel free to add additional helper methods to libs/formats if it
- assists in creating good validation messages for your locale. */ import { sentence as s, list, date, order } from '../formatters' import { FormKitLocaleMessages } from '../i18n'
/**
- Standard language for interface features.
- @public
/
export const ui: FormKitLocaleMessages = {
/*
- Shown when a button to remove items is visible. / remove: 'Radera', /*
- Shown when there are multiple items to remove at the same time. / removeAll: 'Radera alla', /*
- Shown when all fields are not filled out correctly. / incomplete: 'Några fält är inte korrekt ifyllda.', /*
- Shown in a button inside a form to submit the form. / submit: 'Skicka', /*
- Shown when no files are selected. */ noFiles: 'Ingen fil vald', }
/**
- These are all the possible strings that pertain to validation messages.
- @public
/
export const validation: FormKitValidationMessages = {
/*
- The value is not an accepted value.
- @see {@link https://docs.formkit.com/essentials/validation#accepted}
/
accepted({ name }): string {
/
/ return */ },Vänligen acceptera ${name}./
/**
- The date is not after
- @see {@link https://docs.formkit.com/essentials/validation#date-after}
/
date_after({ name, args }) {
if (Array.isArray(args) && args.length) {
/
/ return / } /${s(name)} måste vara efter ${date(args[0])}.// return */ },${s(name)} måste vara i framtiden./
/**
- The value is not a letter.
- @see {@link https://docs.formkit.com/essentials/validation#alpha}
/
alpha({ name }) {
/
/ return */ },${s(name)} får bara innehålla alfanumeriska tecken./
/**
- The value is not alphanumeric
- @see {@link https://docs.formkit.com/essentials/validation#alphanumeric}
/
alphanumeric({ name }) {
/
/ return */ },${s(name)} får bara innehålla bokstäver och nummer./
/**
- The value is not letter and/or spaces
- @see {@link https://docs.formkit.com/essentials/validation#alpha-spaces}
/
alpha_spaces({ name }) {
/
/ return */ },${s(name)} får bara innehålla bokstäver och mellanslag./
/**
- The date is not before
- @see {@link https://docs.formkit.com/essentials/validation#date-before}
/
date_before({ name, args }) {
if (Array.isArray(args) && args.length) {
/
/ return / } /${s(name)} måste vara före ${date(args[0])}// return */ },${s(name)} måste vara i det förgågna/
/**
- The value is not between two numbers
- @see {@link https://docs.formkit.com/essentials/validation#between}
/
between({ name, args }) {
if (isNaN(args[0]) || isNaN(args[1])) {
/
/ return / } const [a, b] = order(args[0], args[1]) /Fältet har konfigurerats inkorrekt och kan inte skickas.// return */ },${s(name)} får bara vara mellan ${a} och ${b}./
/**
- The confirmation field does not match
- @see {@link https://docs.formkit.com/essentials/validation#confirm}
/
confirm({ name }) {
/
/ return */ },${s(name)} matchar inte. ${s(name)} stämmer inte överens./
/**
- The value is not a valid date
- @see {@link https://docs.formkit.com/essentials/validation#date-format}
/
date_format({ name, args }) {
if (Array.isArray(args) && args.length) {
/
/ return / } /${s(name)} är inte ett giltigt datum, vänligen använd formatet ${args[0]}// return 'Fältet har konfigurerats inkorrekt och kan inte skickas.' / */ },
/**
- Is not within expected date range
- @see {@link https://docs.formkit.com/essentials/validation#date-between}
/
date_between({ name, args }) {
/
/ return */ },${s(name)} får endast vara mellan ${date(args[0])} och ${date(args[1])}/
/**
- Shown when the user-provided value is not a valid email address.
- @see {@link https://docs.formkit.com/essentials/validation#email} */ email: 'Ange en giltig e-postadress.',
/**
- Does not end with the specified value
- @see {@link https://docs.formkit.com/essentials/validation#ends-with}
/
ends_with({ name, args }) {
/
/ return */ },${s(name)} avslutas inte med ${list(args)}./
/**
- Is not an allowed value
- @see {@link https://docs.formkit.com/essentials/validation#is}
/
is({ name }) {
/
/ return */ },${s(name)} är inte ett tillåtet värde./
/**
- Does not match specified length
- @see {@link https://docs.formkit.com/essentials/validation#length}
/
length({ name, args: [first = 0, second = Infinity] }) {
const min = Number(first) <= Number(second) ? first : second
const max = Number(second) >= Number(first) ? second : first
if (min == 1 && max === Infinity) {
/
/ return / } if (min == 0 && max) { /${s(name)} måste vara minst ett tecken.// return / } if (min && max === Infinity) { /${s(name)} får endast vara mindre än eller lika med ${max} antal tecken.// return / } /${s(name)} får endast vara större än eller lika med ${min} antal tecken.// return */ },${s(name)} får endast vara mellan ${min} och ${max} antal tecken./
/**
- Value is not a match
- @see {@link https://docs.formkit.com/essentials/validation#matches}
/
matches({ name }) {
/
/ return */ },${s(name)} är inte ett tillåtet värde./
/**
- Exceeds maximum allowed value
- @see {@link https://docs.formkit.com/essentials/validation#max}
/
max({ name, node: { value }, args }) {
if (Array.isArray(value)) {
/
/ return / } /Det går inte att ha mer än ${args[0]} ${name}.// return */ },${s(name)} får endast vara mindre än eller lika med ${args[0]}./
/**
- The (field-level) value does not match specified mime type
- @see {@link https://docs.formkit.com/essentials/validation#mime}
/
mime({ name, args }) {
if (!args[0]) {
/
/ return 'Inga filformat är tillåtna.' / / } // return */ },${s(name)} får endast vara av typen: ${args[0]}/
/**
- Does not fulfill minimum allowed value
- @see {@link https://docs.formkit.com/essentials/validation#min}
/
min({ name, node: { value }, args }) {
if (Array.isArray(value)) {
/
/ return / } /Det går inte att ha mindre än ${args[0]} ${name}.// return */ },${s(name)} behöver vara minst ${args[0]}./
/**
- Is not an allowed value
- @see {@link https://docs.formkit.com/essentials/validation#not}
/
not({ name, node: { value } }) {
/
/ return */ },“${value}” är inte ett tillåtet ${name}./
/**
- Is not a number
- @see {@link https://docs.formkit.com/essentials/validation#number}
/
number({ name }) {
/
/ return */ },${s(name)} får endast vara ett nummer./
/**
- Required field.
- @see {@link https://docs.formkit.com/essentials/validation#required}
/
required({ name }) {
/
/ return */ },${s(name)} krävs./
/**
- Does not start with specified value
- @see {@link https://docs.formkit.com/essentials/validation#starts-with}
/
starts_with({ name, args }) {
/
/ return */ },${s(name)} börjar inte med ${list(args)}./
/**
- Is not a url
- @see {@link https://docs.formkit.com/essentials/validation#url}
/
url() {
/
/ return */ }, }Vänligen inkludera ett giltig adress (URL)./
The chosen responses are more mild, and speaks to the user in a helpful way. I opted to not use the "must" keyword for instance which, in Swedish, may sound a little bit angry and deterring.
The issue with Swedish is that there are a multitude of ways to write these strings and it is hard to make a locale sound natural so there would presumably be (and rightly so) other Swedish speakers who would argue my choice of responses. Mine are more designed to be "hey you forgot this" rather than "THIS IS NOT ALLOWED TO BE EMPTY"
@hglbrg thats for your careful assessment on the translation. There is already a sweedish translation on the upcoming release/beta.7 branch (https://github.com/formkit/formkit/blob/release/beta.7/packages/i18n/src/locales/sv.ts) I'm relatively indifferent to whose version makes it in — would you mind looking that user’s over and seeing if there is anything you want to change?
I have reviewed the link and those strings are good. Use them over mine is my recommendation.
Den tors 5 maj 2022 21:14Justin Schroeder @.***> skrev:
@hglbrg https://github.com/hglbrg thats for your careful assessment on the translation. There is already a sweedish translation on the upcoming release/beta.7 branch ( https://github.com/formkit/formkit/blob/release/beta.7/packages/i18n/src/locales/sv.ts) I'm relatively indifferent to whose version makes it in — would you mind looking that user’s over and seeing if there is anything you want to change?
— Reply to this email directly, view it on GitHub https://github.com/formkit/formkit/issues/218#issuecomment-1118958227, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4RX4JROINJJDHAZFMWUQDVIQMZ5ANCNFSM5U3O32BA . You are receiving this because you were mentioned.Message ID: @.***>
Ok Thanks! Appreciate the time you spent on that 👍