mirror of
				https://github.com/gristlabs/grist-core.git
				synced 2025-06-13 20:53:59 +00:00 
			
		
		
		
	Change translation keys for keys with counts
This commit is contained in:
		
							parent
							
								
									e0ae321ff5
								
							
						
					
					
						commit
						7082e3dce9
					
				@ -20,12 +20,12 @@ export function CellContextMenu(rowOptions: IRowContextMenu, colOptions: IMultiC
 | 
			
		||||
 | 
			
		||||
  const numCols: number = colOptions.numColumns;
 | 
			
		||||
  const nameClearColumns = colOptions.isFiltered ?
 | 
			
		||||
    t("ResetEntireColumns", {count: numCols}) :
 | 
			
		||||
    t("ResetColumns", {count: numCols});
 | 
			
		||||
  const nameDeleteColumns = t("DeleteColumns", {count: numCols});
 | 
			
		||||
    t("Reset {{count}} entire columns", {count: numCols}) :
 | 
			
		||||
    t("Reset {{count}} columns", {count: numCols});
 | 
			
		||||
  const nameDeleteColumns = t("Delete {{count}} columns", {count: numCols});
 | 
			
		||||
 | 
			
		||||
  const numRows: number = rowOptions.numRows;
 | 
			
		||||
  const nameDeleteRows = t("DeleteRows", {count: numRows});
 | 
			
		||||
  const nameDeleteRows = t("Delete {{count}} rows", {count: numRows});
 | 
			
		||||
 | 
			
		||||
  const nameClearCells = (numRows > 1 || numCols > 1) ? t("Clear values") : t("Clear cell");
 | 
			
		||||
 | 
			
		||||
@ -68,7 +68,7 @@ export function CellContextMenu(rowOptions: IRowContextMenu, colOptions: IMultiC
 | 
			
		||||
         menuItemCmd(allCommands.insertRecordAfter, t("Insert row below"),
 | 
			
		||||
                     dom.cls('disabled', disableInsert))]
 | 
			
		||||
    ),
 | 
			
		||||
    menuItemCmd(allCommands.duplicateRows, t("DuplicateRows", {count: numRows}),
 | 
			
		||||
    menuItemCmd(allCommands.duplicateRows, t("Duplicate rows", {count: numRows}),
 | 
			
		||||
        dom.cls('disabled', disableInsert || numRows === 0)),
 | 
			
		||||
    menuItemCmd(allCommands.insertFieldBefore, t("Insert column to the left"),
 | 
			
		||||
                disableForReadonlyView),
 | 
			
		||||
 | 
			
		||||
@ -117,7 +117,7 @@ class ColumnListPicker extends Disposable {
 | 
			
		||||
                col.label.peek(),
 | 
			
		||||
              )),
 | 
			
		||||
              wrongTypeCount > 0 ? menuText(
 | 
			
		||||
                t("WrongTypesMenuText", {wrongTypeCount, columnType: this._column.type.toLowerCase(), count: wrongTypeCount}),
 | 
			
		||||
                t("{{wrongTypeCount}} non-{{columnType}} columns are not shown", {wrongTypeCount, columnType: this._column.type.toLowerCase(), count: wrongTypeCount}),
 | 
			
		||||
                testId('map-message-' + this._column.name)
 | 
			
		||||
              ) : null
 | 
			
		||||
            ];
 | 
			
		||||
 | 
			
		||||
@ -210,19 +210,19 @@ export function buildFormulaConfig(
 | 
			
		||||
  const behaviorName = Computed.create(owner, behavior, (use, type) => {
 | 
			
		||||
    if (use(isMultiSelect)) {
 | 
			
		||||
      const commonType = use(multiType);
 | 
			
		||||
      if (commonType === 'formula') { return t('Formula Column', {count: 2}); }
 | 
			
		||||
      if (commonType === 'data') { return t('Data Column', {count: 2}); }
 | 
			
		||||
      if (commonType === 'formula') { return t('Formula Columns', {count: 2}); }
 | 
			
		||||
      if (commonType === 'data') { return t('Data Columns', {count: 2}); }
 | 
			
		||||
      if (commonType === 'mixed') { return t('Mixed Behavior'); }
 | 
			
		||||
      return t('Empty Column', {count: 2});
 | 
			
		||||
      return t('Empty Columns', {count: 2});
 | 
			
		||||
    } else {
 | 
			
		||||
      if (type === 'formula') { return t('Formula Column', {count: 1}); }
 | 
			
		||||
      if (type === 'data') { return t('Data Column', {count: 1}); }
 | 
			
		||||
      return t('Empty Column', {count: 1});
 | 
			
		||||
      if (type === 'formula') { return t('Formula Columns', {count: 1}); }
 | 
			
		||||
      if (type === 'data') { return t('Data Columns', {count: 1}); }
 | 
			
		||||
      return t('Empty Columns', {count: 1});
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
  const behaviorIcon = Computed.create<IconName>(owner, (use) => {
 | 
			
		||||
    return use(behaviorName) === t('Data Column', {count: 2}) ||
 | 
			
		||||
           use(behaviorName) === t('Data Column', {count: 1}) ? "Database" : "Script";
 | 
			
		||||
    return use(behaviorName) === t('Data Columns', {count: 2}) ||
 | 
			
		||||
           use(behaviorName) === t('Data Columns', {count: 1}) ? "Database" : "Script";
 | 
			
		||||
  });
 | 
			
		||||
  const behaviorLabel = () => selectTitle(behaviorName, behaviorIcon);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -137,7 +137,7 @@ function buildPrompt(tableNames: string[], onSave: (option: RemoveOption) => Pro
 | 
			
		||||
    const saveDisabled = Computed.create(owner, use => use(selected) === '');
 | 
			
		||||
    const saveFunc = () => onSave(selected.get());
 | 
			
		||||
    return {
 | 
			
		||||
      title: t('TableWillNoLongerBeVisible', { count: tableNames.length }),
 | 
			
		||||
      title: t('The following tables will no longer be visible', { count: tableNames.length }),
 | 
			
		||||
      body: dom('div',
 | 
			
		||||
        testId('popup'),
 | 
			
		||||
        buildWarning(tableNames),
 | 
			
		||||
 | 
			
		||||
@ -56,11 +56,11 @@ const PageSubTab = StringUnion("widget", "sortAndFilter", "data");
 | 
			
		||||
export function getFieldType(widgetType: IWidgetType|null) {
 | 
			
		||||
  // A map of widget type to the icon and label to use for a field of that widget.
 | 
			
		||||
  const fieldTypes = new Map<IWidgetType, {label: string, icon: IconName, pluralLabel: string}>([
 | 
			
		||||
    ['record', {label: t('Column', { count: 1 }), icon: 'TypeCell', pluralLabel: t('Column', { count: 2 })}],
 | 
			
		||||
    ['detail', {label: t('Field', { count: 1 }), icon: 'TypeCell', pluralLabel: t('Field', { count: 2 })}],
 | 
			
		||||
    ['single', {label: t('Field', { count: 1 }), icon: 'TypeCell', pluralLabel: t('Field', { count: 2 })}],
 | 
			
		||||
    ['record', {label: t('Columns', { count: 1 }), icon: 'TypeCell', pluralLabel: t('Columns', { count: 2 })}],
 | 
			
		||||
    ['detail', {label: t('Fields', { count: 1 }), icon: 'TypeCell', pluralLabel: t('Fields', { count: 2 })}],
 | 
			
		||||
    ['single', {label: t('Fields', { count: 1 }), icon: 'TypeCell', pluralLabel: t('Fields', { count: 2 })}],
 | 
			
		||||
    ['chart', {label: t('Series', { count: 1 }), icon: 'ChartLine', pluralLabel: t('Series', { count: 2 })}],
 | 
			
		||||
    ['custom', {label: t('Column', { count: 1 }), icon: 'TypeCell', pluralLabel: t('Column', { count: 2 })}],
 | 
			
		||||
    ['custom', {label: t('Columns', { count: 1 }), icon: 'TypeCell', pluralLabel: t('Columns', { count: 2 })}],
 | 
			
		||||
  ]);
 | 
			
		||||
 | 
			
		||||
  return fieldTypes.get(widgetType || 'record') || fieldTypes.get('record')!;
 | 
			
		||||
 | 
			
		||||
@ -31,7 +31,7 @@ export function RowContextMenu({ disableInsert, disableDelete, isViewSorted, num
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
  result.push(
 | 
			
		||||
    menuItemCmd(allCommands.duplicateRows, t('DuplicateRows', { count: numRows }),
 | 
			
		||||
    menuItemCmd(allCommands.duplicateRows, t('Duplicate rows', { count: numRows }),
 | 
			
		||||
      dom.cls('disabled', disableInsert || numRows === 0)),
 | 
			
		||||
  );
 | 
			
		||||
  result.push(
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user