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

CLI generate-proxy: On Turkish Language settings computers, property names starting with 'I' letter is made lower case as turkish 'ı' letter #4589

Closed
HakanBayrak opened this issue Jul 2, 2020 · 2 comments
Assignees
Milestone

Comments

@HakanBayrak
Copy link

HakanBayrak commented Jul 2, 2020

When we generate proxy on a Turkish language setting computer with CLI; file names first letter and property names first letter which is starting with 'I' letter becomes Turkish 'ı' letter (i without a dot on top). This makes no problem for filenames. Also property names starting with 'ı' is not a problem on typescript component.ts files, but they can not be used in html template files.
Also Enum types or navigation properties, as you see at below example, imported correctly but property is referred as 'any' (For this, a new issue may be required?).
And also nullable enum types converted fully incorrect. they can not be compiled.

This is the dto definition:

public class IletisimPersonelDto : FullAuditedEntityDto
    {
        public Guid PersonelKimlikId { get; set; }

        public IletisimReferansi IletisimReferansi { get; set; }

        public string TelefonEv { get; set; }

        public string TelefonIs { get; set; }

        public string TelefonCep { get; set; }

        public string EPosta { get; set; }
    }

and it is converted as "ıletisim-personel-dto.ts" file name (name starts with 'ı')
Content:

import { IletisimReferansi } from './ıletisim-referansi';

import { FullAuditedEntityDto } from '@abp/ng.core';

export class IletisimPersonelDto extends FullAuditedEntityDto {
  personelKimlikId: string;
  ıletisimReferansi: any;
  telefonEv: string;
  telefonIs: string;
  telefonCep: string;
  ePosta: string;
  ısDeleted: boolean;
  deleterId?: string;
  deletionTime?: string;
  lastModificationTime?: string;
  lastModifierId?: string;
  creationTime: string;
  creatorId?: string;

  constructor(initialValues: Partial<IletisimPersonelDto> = {}) {
    super(initialValues);
  }
}
@maliming maliming added this to the 3.1 milestone Jul 3, 2020
@maliming
Copy link
Member

maliming commented Jul 3, 2020

public static string PascalToKebabCase(this string value)
{
if (string.IsNullOrEmpty(value))
{
return value;
}
return Regex.Replace(
value,
"(?<!^)([A-Z][a-z]|(?<=[a-z])[A-Z])",
"-$1",
RegexOptions.Compiled)
.Trim()
.ToLower();

public static class StringExtensions
{
	public static string PascalToKebabCase(this string value)
	{
		if (string.IsNullOrEmpty(value))
		{
			return value;
		}

		using (CultureHelper.Use(CultureInfo.InvariantCulture))
		{
			if (string.IsNullOrEmpty(value))
			{
				return value;
			}

			return Regex.Replace(
				value,
				"(?<!^)([A-Z][a-z]|(?<=[a-z])[A-Z])",
				"-$1",
				RegexOptions.Compiled)
				.Trim()
				.ToLower();
		}
	}
}

@maliming maliming self-assigned this Jul 3, 2020
@maliming
Copy link
Member

Fixed by #4602

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants