Skip to content

Translate in export #6628

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

Closed
sDromacque opened this issue Mar 22, 2018 · 4 comments · Fixed by #6658
Closed

Translate in export #6628

sDromacque opened this issue Mar 22, 2018 · 4 comments · Fixed by #6658

Comments

@sDromacque
Copy link

Hi,

I want to export translated data, in my grid the translation is good, menu is good but in my csv no..
I use this :

  • "angular-ui-grid": "4.0.6",
  • "angular-i18n": "1.5.8",
  • "angular-translate": "2.15.2",

My grid config

enableSorting: false,
enableColumnMenus: true,
showColumnFooter: false,
enableFiltering: false,
enableHorizontalScrollbar: uiGridConstants.scrollbars.NEVER,
enableGridMenu: true,
exporterMenuCsv: true,
gridMenuTitleFilter: $translate,

and example of columnDefs

{
  name: 'color',
  displayName: 'imagineModuleMapTable.column.color',
  field: 'group.business.color.i18nKey',
  cellTooltip: true,
  // grouping: { groupPriority: 4 },
  sort: { priority: 1, direction: 'desc' },
  headerCellFilter: 'translate',
  cellFilter: 'translate'
}

and example of data :

group: {
  business: {
    color: {
      businessKey: "Blanc";
      i18nKey: "referential.color.white"
    }
  }
}  

The data in csv is i18nKey: "referential.color.white"

Thx

@mportuga
Copy link
Member

Could you please provide a plunker of the issue?

@sDromacque
Copy link
Author

it's complicated to reproduce the exact table...sorry :/

@mportuga
Copy link
Member

mportuga commented Mar 23, 2018

I was able to create a plunker that reproduces the issue with a custom filter:
http://plnkr.co/edit/5lPBJlXQB7dhfbGkI9y6?p=preview

@sDromacque
Copy link
Author

ok resolve by :

          exporterFieldCallback: function ( grid, row, col, value ){
            return value
          },
          exporterHeaderFilter: function( displayName ){ 
            return $translate.instant(displayName); 
          },

mportuga pushed a commit that referenced this issue Apr 5, 2018
Ensured that when exporterHeaderFilter and exporterFieldCallback are not defined, that the exporter
will respect the headerCellFilter and cellFilter attributes.

fix #6628, fix #5377, fix #5159
mportuga pushed a commit that referenced this issue Apr 5, 2018
Ensured that when exporterHeaderFilter and exporterFieldCallback are not defined, that the exporter
will respect the headerCellFilter and cellFilter attributes.

fix #6628, fix #5377, fix #5159
defields923 pushed a commit to defields923/ui-grid that referenced this issue Oct 30, 2018
Ensured that when exporterHeaderFilter and exporterFieldCallback are not defined, that the exporter
will respect the headerCellFilter and cellFilter attributes.

fix angular-ui#6628, fix angular-ui#5377, fix angular-ui#5159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants