-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Adding Aliases #4797
Comments
I think the icons should always be found first by the primary version used by the brand themselves, regardless of whether that's the abbreviation or the full title. Having an array of "alisases" as a second level of searching could work quite well, if proper guidelines are applied, as @PeterShaggyNoble lays out above. |
I think it's a great idea! 👍🏼 I would be in favour of adding the aliases to the
The benefit of putting everything into the Another approach would maybe be adding an extra, optional,
|
If we are adding it to I updated the list in the original post with another use case: old brand names, which covers rebrandings and mergers. |
If we're able to include the 'alias' array in the get method of the various forms of the module, would that mitigate some of the breaking change issues we're currently seeing where it's a rename of an existing product? You could just add the "former name" to the alias list, and have the module still find it using that. |
I like this suggestion @PeterShaggyNoble, it provides a solution for quite some old issues and existing issues (e.g. brand renames). Nice 👍 I don't really see a reason not to include it in One suggestion I would like to add to the discussion is the following: in addition to keeping track of aliases, we may consider recording the type of alias as well. This would serve as "documentation", and may give is some automated help w.r.t. keeping the scope of aliases narrow. Following @fbernhart's suggestion, this could look something like:
Where the Alternatively this could be a two-value array (*), e.g.:
(*) I'm not a fan of this, as it is pretty easy to get wrong. |
@ericcornelissen I prefer your first solution there. We could look at having |
I am not against adding this feature, even tho I will question the need, if it is only for the website. If you could use it for selecting the icon it would serve a bigger need – but in this case you need again to ensure the uniqueness – and that is exactly the one thing we can not as it defies the very purpose. |
While including the type of alias, as suggested by @ericcornelissen, could be a useful addition for us, I don't know that the benefits would justify the extra work required of contributors, especially having to check the possible values for the type each time. Therefore my suggestion would be a simple (sorted?) array along the lines of:
or:
|
Though it is definitely up for discussion, I would say that the extra work required by contributors to look up the possible values is quite small compared to what I expect to be relatively common once aliases are a thing:
In other words, from my perspective, forcing contributors to include the type requires them to comply with the scope of aliases we have defined (apart from using the wrong value for a certain type), avoiding the need to ask for changes. Asking this, I think, is much more time consuming than looking of the available types (provided we document them properly). Additionally, remember that aliases are optional, if a contributor can't figure out how to add them they can just leave them out and it can be added later - either in the same PR or in a different PR as adding aliases wouldn't be a breaking change. Lastly, if we open the aliases up to the public, than I think having consistency as to which alias is what is very important. I wouldn't ever use the aliases if for one brand the abbreviation is the first element in the list and for another it is the last item in the list. Provided that we do have the data on aliases available anyway I would say it is quite likely we want to open it up at some point, and I think we would do well to avoid having to do any refactoring for that. I do have further discussions topics regarding including types as well: first is whether a certain type may or may not have multiple values. If not, I think we should use the following approach instead:
Second is whether we should force the title to never be an abbreviation. I get the argument that we should go with what the brand normally does (e.g. how many people want to use the string "Node Package Manager" over "npm"), but I do feel like consistency is more important as well. Additionally, forcing abbreviations into aliases prevents the need for both a |
Given your hypothetical scenario, I can see your point for adding types now. So I'll concede that point 🙂
I do envisage the possibility of multiple aliases of each type so I think we'd need to allow for either an array of (sorted?) strings or a single string for the value. Some scenarios would include:
I would say no. Other than it being a pretty major breaking change given the amount of icons involved, using the full name for the title in all cases wouldn't always be accurate, most especially in the |
Easy way to fix the abbreviation / full name issue as far as I can tell would just be to combine both of them into an |
Combining them into one could be a good compromise, @adamrusted as, realistically, we're never going to have both a full name and an abbreviation. So for the 5 types, we'd have:
So, we would then have something like:
|
With regard to If you wanted to shorten the tags as much as possible, might I suggest:
This would reduce it to 4 short tags, which should cover all eventualities listed above. |
There are a lot of good ideas here! I love the array of objects having the type as key, but I'm not sure it would be the easiest to use for external projects. If I have an external package and want to iterate over every names to search for an icon for example. It might be easier to loop through a single array of objects and checking the name property. It would be more difficult to iterate through an object, then checking if the value type is an array or a string to potentially loop again. |
But access to object keys directly and then only loop through that array would be faster in terms of computation. |
In JavaScript, for example, you could do one of the following to get all the values as a single array:
|
Totally agree, and I'm not against it. Just wanted to mention that it is not necessarily the easiest way. :) |
Just realised I may have misinterpreted your concern, @service-paradis and I do see a potential issue in mixing strings and arrays if someone wants to iterate through each alias type rather than all aliases together as, using my example above, simply doing On sorting: I think we should require that the keys be sorted (so |
I agree. For consistency and ease of searching, keeping any included key as an array (even with a single entry) would make code significantly easier to manage.
Again, yes. I don't think we can reliably combine icons of various alphabets (especially the likes of Chinese and Japanese) into one sorted array. This also goes alongside the issue raised in #4824, in that do we need to specify that the name under which the icon is listed on our system is in the form of a Latin alphabet spelling, so as to not cause issues with our linter trying to parse other languages. |
As much as it pains me as a linguist to say this, I think, for consistency and ease of management, that we do. Letters in Back to the aliases, are all @simple-icons/maintainers then agreed on the following?
On point 8: for languages that don't use the Latin alphabet, care will need to be given that the spelling is actually correct and that we don't include that country's equivalent of "Ltd.", "plc.", "GmbH", etc. such as "株式会社" (kabushiki gaisha or "share company") in Japanese |
Based on some thinking and some internal discussion I want to bring up a few points. But first, let me just put a new example here to see where we are currently at: {
"title": "React",
"aliases": {
"alt": ["doesn't actually have an alt, but this is for the sake of example"],
"dup": ["React native"],
"loc": ["don' know, but this is for the sake of example"],
"old": ["Angular", "of course react wasn't previously called Angular..."]
},
"hex": "61DAFB",
"source": "https://github.com/facebook/create-react-app/blob/282c03f9525fdf8061ffa1ec50dce89296d916bd/test/fixtures/relative-paths/src/logo.svg",
"guidelines": "https://www.example.com/"
} First, regarding:
Just to clarify, @PeterShaggyNoble, you mean aliases have the same restriction as Then, I have three more questions I think we need to tackle before we can implement this:
If we have settled on all of the above, and all agree that the format is good, I think we can go ahead and get this implemented so that new contributions can make use of it and we have the data available. After that we need to concern ourselves with the following (and probably more) questions:
Regarding collisions, it has been discussed that in the NPM package this can be at least partially resolved by adding a (optional) second parameter to the (*) Making the icons available on each of these means the following (creating such files programatically should be fairly straightforward):
|
No, that was referring specifically to not allowing characters from different alphabets in the main
Yes, great idea including the language in the
Yes, as discussed internally, I think that's the way we'll need to go with those ones too with, as you said, the
Was thinking about this last night and I agree. Although, we wouldn't need the So, to summarise, we now have:
With regards to the various packages: As the initial purpose of this issue was merely to add some alternative names so that icons could be discoverable using them on the website, I think we should continue here with that in mind and then, in a separate issue for each package, discuss which, if any, aliases we're going to expose to that package and how we're going to implement them. I already have a number of ideas & suggestions for the NPM package, some of which (I think) will get us around the potential issue of name collisions. |
Just want to chime in about this. It would be more flexible to accept IETF language tag (ex. en-US, fr-CA, ...). I'm in Québec, Canada. It is the only province with french as primary language. There are a a lot of particularity here that differs from the rest of the Canada. Date format, brand name, etc. We're often different from other french places too (we're very A more specific example (related to this project) is Staples. It is called Bureau en gros here in Québec, but is known as Staples everywhere in the world (even in France).
Another note using the same example. The corporation name of Staples in Canada is Staples Canada. Using IETF language tag could also be useful here. ex. Edit: Staples was never added in this package 😅, could be a good first example to use when adding aliases support |
Good shout, @service-paradis; I agree. This would also cover cases where a brand has to go by a different name for legal/trademark reasons in a country with the same language such as "Burger King" being "Hungry Jack's" in Australia. |
Ah okay, thanks for the clarification. So the title stays as it is (Latin symbols, their accented variants, and (some) punctuation only) and allow localisations to be in "any" alphabet - probably limited to either UTF-X or Unicode.
You're right, I somehow mixed up
On the one hand I would be inclined to allow aliases of the type
Agreed 👍
Couldn't agree more, good call @service-paradis 👍 |
Coming back to this on a couple of points:
|
Agreed, that makes sense - provided that we do plan to automatically generate the SVGs of duplicates (which I'm in favor of, e.g. following your suggestion in a different thread).
Good, i agree that that could happen and so we should support it. Ideally, it would only be allowed if it is different from the parent's source but I don't think either |
OK, so, after letting this sit for a while, I have one last suggestion before we proceed to PRS: Would |
I guess that depends on what it should actually be used for 🤔 If it is intended for two brands with the same icon, I think "dup" is clearer, as "alt" suggests (to me) it is an alternative name - which "aka" is for I would say. On that note, I would be fine changing "aka" into "alt".
As per the "definition" on Wikipedia i would say what we're doing is localisation, as the "title" should(?) be the international name (provided it exists). |
Amazing, with #5369 merged (and already some PRs adding alias metadata, e.g. #5615 and #5617), we can start working on including duplicates in at least the NPM package - and subsequently the website. There has been discussion on this before, but we need to decide on how we automatically convert aliases into actual SVGs and icon entries in the NPM package. Here are some initial thoughts
|
what's missing to advance this issue forward? |
While the aliases can already be added to the I would say that at least until a separate thread to discuss the implementation of each alias has been created, this issue should stay open. Alternatively, we could keep this issue open and have it serve as an overview of the process by updating the issue description to something like:
Both closing this or keeping it open this way work for me. |
Kind of issue
Implementation Progress
The process of the implementation of the aliases can be followed here:
old
(Implement functionality based on theold
alias #5859)aka
(tbd)loc
(tbd)dup
(tbd)Description
In somewhat of a follow-up of #3695, although stopping short of adding alternative spellings & keywords, and in light of #3573, I'd like to propose that we somehow add aliases to icons for (sub-)brands that share the same icon and colour (see #3270 for brands that share an icon but not a colour). Only official names should be considered covering the following points:
I would not suggest that this data be added to
simple-icons.json
as I only envisage it being useful for the search feature of the website so it would only lead to unnecessarily bloated files in the package and possible confusion regarding the ability to use icons by calling them by their aliases - to do so would require all aliases, as well as titles, to be unique. I'm open to suggestion on exact implementation, though.Thoughts from @simple-icons/maintainers and community members on whether this would be a useful addition to the project? Any suggestions for additions to the list above?
The text was updated successfully, but these errors were encountered: