Skip to content

Commit

Permalink
Merge pull request #12841 from strapi/translations-cleanup/merge-dupl…
Browse files Browse the repository at this point in the history
…icated-translations

Translations cleanup: merge duplicated translations
  • Loading branch information
vincentbpro committed Mar 23, 2022
2 parents da133ec + 99f8cff commit 20c36e7
Show file tree
Hide file tree
Showing 184 changed files with 255 additions and 1,331 deletions.
Expand Up @@ -21,7 +21,7 @@ const fetchStrapiLatestRelease = async toggleNotification => {
link: {
url: `https://github.com/strapi/strapi/releases/tag/${tag_name}`,
label: {
id: 'notification.version.update.link',
id: 'global.see-more',
},
},
blockTransition: true,
Expand Down
Expand Up @@ -78,7 +78,7 @@ const Blocker = ({ displayedIcon, description, title, isOpen }) => {
rel="noopener noreferrer nofollow"
>
{formatMessage({
id: 'app.components.BlockLink.documentation',
id: 'global.documentation',
defaultMessage: 'Read the documentation',
})}
</Link>
Expand Down
4 changes: 2 additions & 2 deletions packages/core/admin/admin/src/components/LeftMenu/index.js
Expand Up @@ -100,7 +100,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {

<NavSections>
<NavLink to="/content-manager" icon={<Write />}>
{formatMessage({ id: 'content-manager.plugin.name', defaultMessage: 'Content manager' })}
{formatMessage({ id: 'global.content-manager', defaultMessage: 'Content manager' })}
</NavLink>

{pluginsSectionLinks.length > 0 ? (
Expand Down Expand Up @@ -160,7 +160,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
<LinkUser tabIndex={0} onClick={handleToggleUserLinks} to="/me">
<Typography>
{formatMessage({
id: 'app.components.LeftMenu.profile',
id: 'global.profile',
defaultMessage: 'Profile',
})}
</Typography>
Expand Down
Expand Up @@ -148,7 +148,7 @@ const TableRows = ({
onClickDelete(data.id);
}}
label={formatMessage(
{ id: 'app.component.table.delete', defaultMessage: 'Delete {target}' },
{ id: 'global.delete-target', defaultMessage: 'Delete {target}' },
{ target: itemLineText }
)}
noBorder
Expand Down
Expand Up @@ -70,7 +70,7 @@ function SelectMany({
onMenuOpen={onMenuOpen}
onMenuScrollToBottom={onMenuScrollToBottom}
placeholder={formatMessage(
placeholder || { id: 'components.Select.placeholder', defaultMessage: 'Select...' }
placeholder || { id: 'global.select', defaultMessage: 'Select...' }
)}
styles={styles}
value={[]}
Expand Down
Expand Up @@ -46,7 +46,7 @@ function SelectOne({
onMenuOpen={onMenuOpen}
onMenuScrollToBottom={onMenuScrollToBottom}
placeholder={formatMessage(
placeholder || { id: 'components.Select.placeholder', defaultMessage: 'Select...' }
placeholder || { id: 'global.select', defaultMessage: 'Select...' }
)}
styles={styles}
value={isNull(value) ? null : { label: get(value, [mainField.name], ''), value }}
Expand Down
Expand Up @@ -44,7 +44,7 @@ const FieldButtonContent = ({ attribute, onEditField, onDeleteField, children })
<CustomIconButton
label={formatMessage(
{
id: getTrad('app.component.table.delete'),
id: 'global.delete-target',
defaultMessage: `Delete {target}`,
},
{
Expand Down
Expand Up @@ -72,7 +72,7 @@ const FormModal = ({ onToggle, onMetaChange, onSizeChange, onSubmit, type }) =>
}
endActions={
<Button type="submit">
{formatMessage({ id: 'form.button.finish', defaultMessage: 'Finish' })}
{formatMessage({ id: 'global.finish', defaultMessage: 'Finish' })}
</Button>
}
/>
Expand Down
Expand Up @@ -250,7 +250,7 @@ const EditSettingsView = ({ mainLayout, components, isContentTypeView, slug, upd
to="/"
>
{formatMessage({
id: 'app.components.go-back',
id: 'global.back',
defaultMessage: 'Back',
})}
</Link>
Expand All @@ -261,7 +261,7 @@ const EditSettingsView = ({ mainLayout, components, isContentTypeView, slug, upd
startIcon={<Check />}
type="submit"
>
{formatMessage({ id: 'form.button.save', defaultMessage: 'Save' })}
{formatMessage({ id: 'global.save', defaultMessage: 'Save' })}
</Button>
}
/>
Expand Down
Expand Up @@ -172,7 +172,7 @@ const Header = ({
to="/"
>
{formatMessage({
id: 'app.components.HeaderLayout.link.go-back',
id: 'global.back',
defaultMessage: 'Back',
})}
</Link>
Expand Down
Expand Up @@ -113,7 +113,7 @@ const EditFieldForm = ({
}
endActions={
<Button type="submit">
{formatMessage({ id: 'form.button.finish', defaultMessage: 'Finish' })}
{formatMessage({ id: 'global.finish', defaultMessage: 'Finish' })}
</Button>
}
/>
Expand Down
Expand Up @@ -191,7 +191,7 @@ const ListSettingsView = ({ layout, slug }) => {
<HeaderLayout
navigationAction={
<Link startIcon={<ArrowLeft />} to={goBackUrl} id="go-back">
{formatMessage({ id: 'app.components.go-back', defaultMessage: 'Back' })}
{formatMessage({ id: 'global.back', defaultMessage: 'Back' })}
</Link>
}
primaryAction={
Expand All @@ -201,7 +201,7 @@ const ListSettingsView = ({ layout, slug }) => {
disabled={isEqual(modifiedData, initialData)}
type="submit"
>
{formatMessage({ id: 'form.button.save', defaultMessage: 'Save' })}
{formatMessage({ id: 'global.save', defaultMessage: 'Save' })}
</Button>
}
subtitle={formatMessage({
Expand Down
Expand Up @@ -267,7 +267,7 @@ function ListView({
navigationAction={
<Link startIcon={<ArrowLeft />} to="/content-manager/">
{formatMessage({
id: 'app.components.HeaderLayout.link.go-back',
id: 'global.back',
defaultMessage: 'Back',
})}
</Link>
Expand Down Expand Up @@ -388,9 +388,6 @@ export function mapDispatchToProps(dispatch) {
dispatch
);
}
const withConnect = connect(
mapStateToProps,
mapDispatchToProps
);
const withConnect = connect(mapStateToProps, mapDispatchToProps);

export default compose(withConnect)(memo(ListView, isEqual));
6 changes: 3 additions & 3 deletions packages/core/admin/admin/src/hooks/useMenu/reducer.js
Expand Up @@ -10,7 +10,7 @@ const initialState = {
{
icon: Puzzle,
intlLabel: {
id: 'app.components.LeftMenuLinkContainer.listPlugins',
id: 'global.plugins',
defaultMessage: 'Plugins',
},
to: '/list-plugins',
Expand All @@ -19,7 +19,7 @@ const initialState = {
{
icon: ShoppingCart,
intlLabel: {
id: 'app.components.LeftMenuLinkContainer.installNewPlugin',
id: 'global.marketplace',
defaultMessage: 'Marketplace',
},
to: '/marketplace',
Expand All @@ -28,7 +28,7 @@ const initialState = {
{
icon: Cog,
intlLabel: {
id: 'app.components.LeftMenuLinkContainer.settings',
id: 'global.settings',
defaultMessage: 'Settings',
},
to: '/settings',
Expand Down
Expand Up @@ -15,7 +15,7 @@ const useReleaseNotification = () => {
link: {
url: `https://github.com/strapi/strapi/releases/tag/${latestStrapiReleaseTag}`,
label: {
id: 'notification.version.update.link',
id: 'global.see-more',
},
},
blockTransition: true,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/admin/admin/src/hooks/useSettingsMenu/init.js
Expand Up @@ -25,14 +25,14 @@ const init = (initialState, { settings, shouldUpdateStrapi }) => {
intlLabel: { id: 'Settings.permissions', defaultMessage: 'Administration Panel' },
links: [
{
intlLabel: { id: 'Settings.permissions.menu.link.roles.label', defaultMessage: 'Roles' },
intlLabel: { id: 'global.roles', defaultMessage: 'Roles' },
to: '/settings/roles',
id: 'roles',
isDisplayed: false,
permissions: adminPermissions.settings.roles.main,
},
{
intlLabel: { id: 'Settings.permissions.menu.link.users.label' },
intlLabel: { id: 'global.users' },
// Init the search params directly
to: '/settings/users?pageSize=10&page=1&sort=firstname',
id: 'users',
Expand Down
Expand Up @@ -75,7 +75,7 @@ const Onboarding = () => {
{
icon: 'book',
label: formatMessage({
id: 'app.components.LeftMenuFooter.documentation',
id: 'global.documentation',
defaultMessage: 'Documentation',
}),
destination: 'https://docs.strapi.io',
Expand Down
Expand Up @@ -107,7 +107,7 @@ const Login = ({ onSubmit, schema, children }) => {
onChange={handleChange}
value={values.password}
label={formatMessage({
id: 'Auth.form.password.label',
id: 'global.password',
defaultMessage: 'Password',
})}
name="password"
Expand Down
Expand Up @@ -231,7 +231,7 @@ const Register = ({ authType, fieldsToDisable, noSignin, onSubmit, schema }) =>
})}
required
label={formatMessage({
id: 'Auth.form.password.label',
id: 'global.password',
defaultMessage: 'Password',
})}
type={passwordShown ? 'text' : 'password'}
Expand Down
Expand Up @@ -53,7 +53,7 @@ const ForgotPassword = ({ onSubmit, schema }) => {
<Box paddingTop={6} paddingBottom={7}>
<Typography as="h1" variant="alpha">
{formatMessage({
id: 'Auth.reset-password.title',
id: 'global.reset-password',
defaultMessage: 'Reset password',
})}
</Typography>
Expand Down Expand Up @@ -114,7 +114,7 @@ const ForgotPassword = ({ onSubmit, schema }) => {
})}
required
label={formatMessage({
id: 'Auth.form.password.label',
id: 'global.password',
defaultMessage: 'Password',
})}
type={passwordShown ? 'text' : 'password'}
Expand Down Expand Up @@ -161,7 +161,7 @@ const ForgotPassword = ({ onSubmit, schema }) => {
/>
<Button fullwidth type="submit">
{formatMessage({
id: 'Auth.form.button.reset-password',
id: 'global.change-password',
defaultMessage: 'Change password',
})}
</Button>
Expand Down
Expand Up @@ -24,7 +24,7 @@ const ContentBlocks = () => {
>
<ContentBox
title={formatMessage({
id: 'app.components.BlockLink.documentation',
id: 'global.documentation',
defaultMessage: 'Documentation',
})}
subtitle={formatMessage({
Expand Down
Expand Up @@ -16,7 +16,7 @@ const Plugins = () => {
const toggleNotification = useNotification();

const title = formatMessage({
id: 'app.components.ListPluginsPage.title',
id: 'global.plugins',
defaultMessage: 'Plugins',
});

Expand Down Expand Up @@ -70,15 +70,15 @@ const Plugins = () => {
<Th>
<Typography variant="sigma" textColor="neutral600">
{formatMessage({
id: 'Settings.roles.list.header.name',
id: 'global.name',
defaultMessage: 'Name',
})}
</Typography>
</Th>
<Th>
<Typography variant="sigma" textColor="neutral600">
{formatMessage({
id: 'Settings.roles.list.header.description',
id: 'global.description',
defaultMessage: 'description',
})}
</Typography>
Expand Down
Expand Up @@ -8,7 +8,7 @@ import Plugins from './Plugins';
const InstalledPluginsPage = () => {
const { formatMessage } = useIntl();
const title = formatMessage({
id: 'app.components.ListPluginsPage.title',
id: 'global.plugins',
defaultMessage: 'Plugins',
});

Expand Down
Expand Up @@ -46,7 +46,7 @@ const MarketPlacePage = () => {
/>
<HeaderLayout
title={formatMessage({
id: 'admin.pages.MarketPlacePage.title',
id: 'global.marketplace',
defaultMessage: 'Marketplace',
})}
subtitle={formatMessage({
Expand Down
10 changes: 5 additions & 5 deletions packages/core/admin/admin/src/pages/ProfilePage/index.js
Expand Up @@ -176,7 +176,7 @@ const ProfilePage = () => {
title={data.username || getFullName(data.firstname, data.lastname)}
primaryAction={
<Button startIcon={<Check />} loading={isSubmitting} type="submit">
{formatMessage({ id: 'form.button.save', defaultMessage: 'Save' })}
{formatMessage({ id: 'global.save', defaultMessage: 'Save' })}
</Button>
}
/>
Expand All @@ -195,7 +195,7 @@ const ProfilePage = () => {
<Stack spacing={4}>
<Typography variant="delta" as="h2">
{formatMessage({
id: 'Settings.profile.form.section.profile.title',
id: 'global.profile',
defaultMessage: 'Profile',
})}
</Typography>
Expand Down Expand Up @@ -266,7 +266,7 @@ const ProfilePage = () => {
<Stack spacing={4}>
<Typography variant="delta" as="h2">
{formatMessage({
id: 'Settings.profile.form.section.password.title',
id: 'global.change-password',
defaultMessage: 'Change password',
})}
</Typography>
Expand Down Expand Up @@ -329,7 +329,7 @@ const ProfilePage = () => {
onChange={handleChange}
value={values.password || ''}
label={formatMessage({
id: 'Auth.form.password.label',
id: 'global.password',
defaultMessage: 'Password',
})}
name="password"
Expand Down Expand Up @@ -451,7 +451,7 @@ const ProfilePage = () => {
defaultMessage: 'Interface language',
})}
placeholder={formatMessage({
id: 'components.Select.placeholder',
id: 'global.select',
defaultMessage: 'Select',
})}
hint={formatMessage({
Expand Down
Expand Up @@ -30,7 +30,7 @@ const SettingsNav = ({ menu }) => {
});

const label = formatMessage({
id: 'app.components.LeftMenuLinkContainer.settings',
id: 'global.settings',
defaultMessage: 'Settings',
});

Expand Down
Expand Up @@ -26,7 +26,7 @@ const menu = [
intlLabel: { id: 'Settings.permissions', defaultMessage: 'Administration Panel' },
links: [
{
intlLabel: { id: 'Settings.permissions.menu.link.roles.label', defaultMessage: 'Roles' },
intlLabel: { id: 'global.roles', defaultMessage: 'Roles' },
to: '/settings/roles',
id: 'roles',
isDisplayed: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/admin/admin/src/pages/SettingsPage/index.js
Expand Up @@ -47,7 +47,7 @@ function SettingsPage() {
}

const settingTitle = formatMessage({
id: 'app.components.LeftMenuLinkContainer.settings',
id: 'global.settings',
defaultMessage: 'Settings',
});

Expand Down
Expand Up @@ -21,7 +21,7 @@ const LoadingView = ({ apiTokenName }) => {
<HeaderLayout
primaryAction={
<Button disabled startIcon={<Check />} type="button" size="L">
{formatMessage({ id: 'form.button.save', defaultMessage: 'Save' })}
{formatMessage({ id: 'global.save', defaultMessage: 'Save' })}
</Button>
}
title={
Expand Down

0 comments on commit 20c36e7

Please sign in to comment.