Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization issue #40

Closed
ademc opened this issue Nov 9, 2015 · 7 comments
Closed

Localization issue #40

ademc opened this issue Nov 9, 2015 · 7 comments

Comments

@ademc
Copy link

ademc commented Nov 9, 2015

Hi,

I deployed my project to public web server. I changed globalication configuration:

but always welcome message and some other texts stay original.

I realized that [Web project]Project.Texts strings always show original (english) format. How can i change to turkish language.

@VictorTomaili
Copy link
Member

[ProjectName].Web/Scripts/site/texts/site.texts.*.json
there is json file for localization. Also you need change this value
https://github.com/volkanceylan/Serene/blob/master/Serene/Serene.Web/Web.config#L26

@ademc
Copy link
Author

ademc commented Nov 9, 2015

Yes I know that. But I translate all these files and fields
For instance site.texts.tr.json file like this

{
    "Db.Administration.Language.EntityPlural": "Diller",
    "Db.Administration.Language.EntitySingular": "Dil",
    "Db.Administration.Language.Id": "ID",
    "Db.Administration.Language.LanguageId": "Dil ID",
    "Db.Administration.Language.LanguageName": "Dil Adı",
    "Db.Administration.Role.EntityPlural": "Roller",
    "Db.Administration.Role.EntitySingular": "Rol",
    "Db.Administration.Role.RoleId": "Rol ID",
    "Db.Administration.Role.RoleName": "Rol Adı",
    "Db.Administration.RolePermission.EntityPlural": "Rol Hakları",
    "Db.Administration.RolePermission.EntitySingular": "Rol Hakkı",
    "Db.Administration.RolePermission.PermissionKey": "Hak Kodu",
    "Db.Administration.RolePermission.RoleId": "Rol ID",
    "Db.Administration.RolePermission.RolePermissionId": "Rol Hak ID",
    "Db.Administration.Translation.CustomText": "Hedef Dildeki Kullanıcı Çevirisi",
    "Db.Administration.Translation.EntityPlural": "Çeviriler",
...
}

but still shown these values:

[NestedLocalTexts]
    public static partial class Texts
    {
        public static class Db
        {
            public static class Administration
            {
                public static class Translation
                {
                    public static LocalText EntityPlural = "Translations";
                    public static LocalText Key = "Local Text Key";
                    public static LocalText SourceLanguage = "Source Language";
                    public static LocalText SourceText = "Effective Translation in Source Language";
                    public static LocalText TargetLanguage = "Target Language";
                    public static LocalText TargetText = "Effective Translation in Target Language";
                    public static LocalText CustomText = "User Translation in Target Language";
                    public static LocalText OverrideConfirmation = "Overwrite user translation with clicked text?";
                    public static LocalText SaveChangesButton = "Save Changes";
                }
            }
        }

        public static class Forms
        {
            public static class Membership
            {
                public static class Login
                {
                    public static LocalText FormTitle = "Welcome to GİMNET";
                    public static LocalText SignInButton = "Sign In";
                }
            }
        }

        public static class Navigation
        {
            public static LocalText LogoutLink = "Logout";
            public static LocalText SiteTitle = "Gimnet";
        }

        public static class Site
        {
            public static class Dashboard
            {
                public static LocalText WelcomeMessage = "Welcome to GIMNET home page. " +
                    "Use the navigation on left to browse other pages...";
            }

            public static class UserDialog
            {
                public static LocalText EditPermissionsButton = "Edit Permissions";
                public static LocalText EditRolesButton = "Edit Roles";
            }

            public static class UserRoleDialog
            {
                public static LocalText DialogTitle = "Edit User Roles ({0})";
                public static LocalText SaveSuccess = "Updated user roles.";
            }

            public static class UserPermissionDialog
            {
                public static LocalText DialogTitle = "Edit User Permissions ({0})";
                public static LocalText SaveSuccess = "Updated user permissions.";
            }

            public static class RolePermissionDialog
            {
                public static LocalText EditButton = "Edit Permissions";
                public static LocalText DialogTitle = "Edit Role Permissions ({0})";
                public static LocalText SaveSuccess = "Updated role permissions.";
            }

            public static class ThemeSelection
            {
                public static LocalText Theme = "Theme";
                public static LocalText Default = "Dark Theme";
                public static LocalText Light = "Light Theme";
            }
        }

        public static class Validation
        {
            public static LocalText DeleteForeignKeyError = "Can't delete record. '{0}' table has " +
                "records that depends on this one!";
            public static LocalText NorthwindPhone = "Phone numbers should be entered in format '(503) 555-9831'.";
            public static LocalText NorthwindPhoneMultiple = "Phone numbers should be entered in format '(503) 555-9831. " +
                "Multiple numbers can be separated with comma.";
            public static LocalText SavePrimaryKeyError = "Can't save record. There is another record with the same {1} value!";
        }

@volkanceylan
Copy link
Member

These texts are changed to actual LocalText objects containing local text keys by NestedLocalTextRegistration. Seems like it is a initialization issue. Maybe ExtensibilityHelper.SelfAssemblies is set to something wrong. I'll have a look.

@volkanceylan
Copy link
Member

Can you please check if your JSON file has a syntax error. There is a known issue with such invalid files. Local text system swallows errors and ignores the file if it has a JSON syntax error.

@ademc
Copy link
Author

ademc commented Nov 9, 2015

I have checked json file(s); it is valid. I have no issue while development time. Issue has ocured when published. Is there any special operation or procedure I have to consider for deployment.

@volkanceylan
Copy link
Member

Did you use Visual Studio publish? site.texts.tr.json has build action of None while other json files has build action of Content. Maybe VS didn't publish them to your server?

I checked this and yes only site.texts.tr.json has such build action and publish doesn't copy it to output directory. I'll update Serene template.

@ademc
Copy link
Author

ademc commented Nov 9, 2015

So sorry. I did not check serenity.texts.tr.json file from server. I saw another json files but did not look carefully i guess. Yes there is no serenity.texts.tr.json file on server.

Please update SERENE template for absent-minded developers like me. Thank you.

@ademc ademc closed this as completed Nov 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants