| 117 | } |
| 118 | |
| 119 | static LocalizedNameMap copyLibraryElementNames(const LocalizedNameMap& names) { |
| 120 | // Note: We copy only the default locale for now because the UI doesn't show |
| 121 | // the other locales so the user can't edit them. |
| 122 | QString newNameStr = *names.getDefaultValue() % " (" % |
| 123 | MainWindow::tr("Copy", "The noun (a copy of), not the verb (to copy)") % |
| 124 | ")"; |
| 125 | if (auto newName = parseElementName(newNameStr)) { |
| 126 | return LocalizedNameMap(*newName); |
| 127 | } |
| 128 | newNameStr = *names.getDefaultValue() % " (Copy)"; |
| 129 | if (auto newName = parseElementName(newNameStr)) { |
| 130 | return LocalizedNameMap(*newName); |
| 131 | } |
| 132 | return LocalizedNameMap(names.getDefaultValue()); |
| 133 | } |
| 134 | |
| 135 | template <typename T> |
| 136 | static void duplicateLibraryElement(T& element, const T& other) { |
no test coverage detected