### What? Localizer's RTL code was not being applied, to shift it's position to the left side of the screen when the user's account/admin locale was set to a RTL language. Before:  After:  ### How? Moved css class to ensure existing css code did not face issues with inheritance. Fixes #9482
66 lines
1.5 KiB
TypeScript
66 lines
1.5 KiB
TypeScript
import { fileURLToPath } from 'node:url'
|
|
import path from 'path'
|
|
const filename = fileURLToPath(import.meta.url)
|
|
const dirname = path.dirname(filename)
|
|
import { ar } from '@payloadcms/translations/languages/ar'
|
|
import { de } from '@payloadcms/translations/languages/de'
|
|
import { en } from '@payloadcms/translations/languages/en'
|
|
import { es } from '@payloadcms/translations/languages/es'
|
|
|
|
import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
|
|
import { devUser } from '../credentials.js'
|
|
import { Posts } from './collections/posts.js'
|
|
import { Users } from './collections/users.js'
|
|
import deepMerge from './deepMerge.js'
|
|
|
|
export default buildConfigWithDefaults({
|
|
admin: {
|
|
importMap: {
|
|
baseDir: path.resolve(dirname),
|
|
},
|
|
},
|
|
collections: [Users, Posts],
|
|
/*i18n: {
|
|
fallbackLng: 'en', // default
|
|
debug: false, // default
|
|
resources: {
|
|
ar: deepMerge(en, ar),
|
|
},
|
|
},*/
|
|
localization: {
|
|
locales: [
|
|
{
|
|
label: 'English',
|
|
code: 'en',
|
|
},
|
|
{
|
|
label: 'Arabic',
|
|
code: 'ar',
|
|
rtl: true,
|
|
},
|
|
],
|
|
defaultLocale: 'en',
|
|
fallback: true,
|
|
},
|
|
i18n: {
|
|
supportedLanguages: {
|
|
ar,
|
|
en,
|
|
es,
|
|
de,
|
|
},
|
|
},
|
|
onInit: async (payload) => {
|
|
await payload.create({
|
|
collection: 'users',
|
|
data: {
|
|
email: devUser.email,
|
|
password: devUser.password,
|
|
},
|
|
})
|
|
},
|
|
typescript: {
|
|
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
|
},
|
|
})
|