m-kovalsky / fabric_cat_tools

Supercharge your Microsoft Fabric development with the fabric_cat_tools library
MIT License
100 stars 14 forks source link

[Question] translate_semantic_model lacks support for column names seperated with underscores. #12

Closed BDOlode closed 1 month ago

BDOlode commented 1 month ago

The translation function lacks support for names seperated by underscores, is it possible to define word seperators ?

f.e. below script attempting translation to norwegian: Translating Names... Added the 'nb' language Translation 'dim_accounts' set for the 'nb' language on the 'dim_accounts' table. Translation 'account_no_name' set on the 'account_no_name' column within the dim_accounts' table. Translation 'group1_code' set on the 'group1_code' column within the dim_accounts' table.

m-kovalsky commented 1 month ago

It's probably a better idea to use friendly names for your tables/columns/measures/hierarchies. Then you won't encounter this problem. It appears the translation tool doesn't understand word separators and I'm not exactly sure if that is a feature in the translator. In the meantime, I could have it just replace underscores with spaces - although there may be other types of word separators.

BDOlode commented 1 month ago

Or potentially an extra function argument for characters to be excluded?

Additionally, do you intend to open source the code, such that others can make adaptations specific to their use cases?

m-kovalsky commented 1 month ago

Ah true, that's a good, simple option. With regard to open sourcing we'll see. If you have any ideas/requests feel free to submit them here (as you're already doing).

m-kovalsky commented 1 month ago

In the next version you will be able to specify a string of characters which will be excluded (each of these characters will be replaced by a space. So if you had a table name of 'Dim_Account - Sales' it would get translated as 'Dim Account Sales' (in the example below).

fct.translate_semantic_model(dataset = '', languages = ['it-IT', 'fr-FR'], exclude_characters = '_-', workspace = None)
m-kovalsky commented 1 month ago

See 0.4.1