You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/content/contributor-docs/en/access.mdx
+14-10
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,36 @@
1
+
{/* What our commitment to access means for contributors and users of the library. */}
2
+
1
3
# Our Focus on Access
2
4
3
5
At the [2019 Contributors Conference](https://p5js.org/community/contributors-conference-2019.html), p5.js made the commitment to only add new features that increase access (inclusion and accessibility). We will not accept feature requests that don't support these efforts. We commit to the work of acknowledging, dismantling, and preventing barriers. This means considering intersecting[^1] experiences of diversity that can impact access and participation. These include alignments of gender, race, ethnicity, sexuality, language, location, et cetera. We center the needs of marginalized groups over the continued comfort of those privileged within the p5.js community. We are collectively exploring the meaning of access. We are learning how to practice and teach access. We choose to think of access through expansive, intersectional, and coalitionary frameworks. This commitment is part of the core values of p5.js outlined in our [Community Statement](https://p5js.org/community/).
4
6
5
7
# Kinds of access
6
8
7
-
Increasing access is not focused on expanding the raw number of people in the p5.js community. Instead, we want to make p5.js available for people who get left out of the community. This is often a consequence of structural bias. This commitment extends to the tools and platforms p5.js offers. It also includes the makeup, decision-making, and actions of p5.js leadership. We resist a technological culture of speed, growth and competition. We prioritize intentionality, slowness, accommodation, and accountability as acts of collective care.
9
+
Increasing access is not focused on expanding the raw number of people in the p5.js community. It is a continued commitment to making p5.js available to and approachable for people who have been excluded from the p5.js community as a consequence of structural oppression. This commitment extends to the tools and platforms p5.js offers. It also includes the makeup, decision-making, and actions of p5.js leadership. We resist a technological culture of speed, growth, and competition. We prioritize intentionality, slowness, accommodation, and accountability as acts of collective care.
8
10
9
11
Access here means making p5.js equitable for:
10
12
11
13
* People who speak languages other than English
12
-
* People of color and people of marginalized ethnic identities
13
-
* Lesbian, gay, bisexual, trans, queer, questioning, intersex, pansexual, two-spirit, and asexual people
14
-
*Women and people with other marginalized gender expressions
15
-
*Disabled people/people with disabilities, neurodivergent people/people with neurodivergence, and chronically ill people/people with chronic illness[^2]
14
+
*Black, Indigenous, People of Color, and people of marginalized ethnicities
15
+
* Lesbian, gay, bisexual, queer, questioning, pansexual, and asexual people
16
+
*Trans, genderfluid, agender, intersex, and two-spirit people, women, and others with marginalized genders
17
+
*People who are blind, d/Deaf[^2] or hard of hearing, disabled/have a disability, neurodivergent, and chronically ill[^3]
16
18
* People who have lower income, or lack access to financial or cultural capital
17
19
* People with little or no prior experience in open source and creative coding
18
20
* People from diverse educational backgrounds
19
21
* People across all age groups, including children and elders
20
-
* People with a variety of technological skill, tools and internet access
22
+
* People with a variety of technological skill, tools, and internet access
21
23
* People from diverse religious backgrounds
22
24
* Other people who are systematically excluded and historically underrepresented
23
25
* And all intersections thereof
24
26
25
-
We recognize the complexity of the terms used to describe our respective identities. Language is nuanced, evolving and contested. This is not an exhaustive list. We provide an attempt to name and be accountable to our commitments and to the diverse needs of the p5.js community.
27
+
We recognize the complexity of the terms used to describe our respective identities. Language is nuanced, evolving, and contested. This is not an exhaustive list. We provide an attempt to name and be accountable to our commitments and to the diverse needs of the p5.js community.
26
28
27
29
# Examples
28
30
29
31
These are examples of efforts we believe increase access:
30
32
31
-
* Translating documentation and other materials into more languages, decentering linguistic imperialism[^3] (e.g., Rolando Vargas’ [Processing in Kuna Language](https://medium.com/@ProcessingOrg/culture-as-translation-processing-in-kuna-language-with-rolando-vargas-and-edinson-izquierdo-8079f14851f7), Felipe Santos Gomes, Julia Brasil, Katherine Finn Zander, and Marcela Mancino’s [Pê Cinco: Internationalization and Popularization for Portuguese Speakers](https://medium.com/processing-foundation/translating-p5-js-into-portuguese-for-the-brazilian-community-14b969e77ab1))
33
+
* Translating documentation and other materials into more languages, decentering linguistic imperialism[^4] (e.g., Rolando Vargas’ [Processing in Kuna Language](https://medium.com/@ProcessingOrg/culture-as-translation-processing-in-kuna-language-with-rolando-vargas-and-edinson-izquierdo-8079f14851f7), Felipe Santos Gomes, Julia Brasil, Katherine Finn Zander, and Marcela Mancino’s [Pê Cinco: Internationalization and Popularization for Portuguese Speakers](https://medium.com/processing-foundation/translating-p5-js-into-portuguese-for-the-brazilian-community-14b969e77ab1))
32
34
* Improving our support for assistive technologies, such as screen readers (e.g., Katie Liu’s [Adding Alt Text in p5.js](https://medium.com/processing-foundation/adding-alt-text-e2c7684e44f8), Claire Kearney-Volpe’s [P5 Accessibility Project](https://medium.com/processing-foundation/p5-accessibility-115d84535fa8))
33
35
* Following [Web Content Accessibility Guidelines](https://www.w3.org/TR/WCAG21/) in our tools and working towards making it easier for users to follow them in their projects
34
36
* Making p5.js error messages more helpful and supportive to people using the tool (e.g., the [p5.js Friendly Error System (FES)](https://github.com/processing/p5.js/blob/main/contributor_docs/friendly_error_system/))
@@ -51,6 +53,8 @@ This version of the p5.js Access Statement was revised in collaboration with Eve
51
53
52
54
[^1]: Crenshaw, Kimberlé (1989). "Demarginalizing the intersection of race and sex: a black feminist critique of antidiscrimination doctrine, feminist theory and antiracist politics". University of Chicago Legal Forum. 1989 (1): 139–167. ISSN 0892-5593. Full text at Archive.org.
53
55
54
-
[^2]: There are differing preferences between ‘person-first’ vs. ‘identity-first’ language within the disability community. Read [Unpacking the debate over person-first vs. identity-first language in the autism community](https://news.northeastern.edu/2018/07/12/unpacking-the-debate-over-person-first-vs-identity-first-language-in-the-autism-community/) and [I am Disabled: On Identity-First Versus People-First Language](https://thebodyisnotanapology.com/magazine/i-am-disabled-on-identity-first-versus-people-first-language/).
56
+
[^2]: Capital ‘D’ Deaf refers to people who are culturally Deaf or part of the Deaf community while lower case ‘d’ deaf is an audiological term that can describe people not associated with Deaf identity.
57
+
58
+
[^3]: There are differing preferences between ‘person-first’ vs. ‘identity-first’ language within the disability community. Read [Unpacking the debate over person-first vs. identity-first language in the autism community](https://news.northeastern.edu/2018/07/12/unpacking-the-debate-over-person-first-vs-identity-first-language-in-the-autism-community/) and [I am Disabled: On Identity-First Versus People-First Language](https://thebodyisnotanapology.com/magazine/i-am-disabled-on-identity-first-versus-people-first-language/).
55
59
56
-
[^3]: Linguistic Imperialism, or Language Imperialism, refers to the ongoing domination/prioritization/imposition of certain languages such as English at the expense of native languages due to imperial expansion and globalization.
60
+
[^4]: Linguistic Imperialism, or Language Imperialism, refers to the ongoing domination/prioritization/imposition of certain languages such as English at the expense of native languages due to imperial expansion and globalization.
{/* Instructions on how to combine just the p5.js modules you need into a single file. */}
2
+
3
+
# Creating a custom build of p5.js with select components
4
+
5
+
## Overview
6
+
7
+
An excellent new [feature](https://github.com/processing/p5.js/pull/2051) of p5.js allows user to build p5.js as a custom combination of its modules. This greatly helps in reducing the production version size of the library, as well as improves overall performance.
8
+
9
+
This feature was suggested as a part of a proposal for Google Summer of Code 2017.
10
+
11
+
## Usage
12
+
13
+
Currently, the usage is through invoking a Grunt task manually from the command line:
14
+
15
+
```sh
16
+
git clone https://github.com/processing/p5.js.git
17
+
cd p5.js
18
+
npm ci
19
+
npm run grunt
20
+
npm run grunt combineModules:module_x:module_y
21
+
```
22
+
23
+
Here, `module_n` refers to the name of the modules which you want to select. Multiple modules must be passed as shown above. Also, these modules must have the same name as their folders in `/src` directory to work correctly. While `core` is included by default, `core/shape` needs to be included for shapes like line() and other core features to work.
24
+
25
+
The above usage example will likely output a `p5Custom.js` larger than the complete `p5.min.js` as the output is not minified using the `uglify` task.
26
+
27
+
The recommended steps to reduce bundle size as much as possible are:
28
+
29
+
```sh
30
+
git clone https://github.com/processing/p5.js.git
31
+
cd p5.js
32
+
npm ci
33
+
npm run grunt
34
+
npm run grunt combineModules:min:module_x:module_y uglify
35
+
```
36
+
37
+
## Examples
38
+
39
+
*`npm run grunt combineModules:min:core/shape:color:math:image uglify`\
40
+
Generates a `p5Custom.min.js` bundle in the `lib/modules` directory with the combineModules and uglify tasks. Note that modules should be listed after `combineModules:min` and the `uglify` task should have a space after the modules list.
41
+
42
+
*`npm run grunt combineModules:core/shape:color:math:image`\
43
+
Generates a non-minified `p5Custom.js` bundle in the `lib/modules` directory.
44
+
45
+
*`npm run grunt combineModules:min:core/shape:color:math:image`\
46
+
Generates a `p5Custom.pre-min.js` in the `lib/modules` directory with the `combineModules:min` task. Note that in this example `npm run grunt uglify` can be run separately after running the `combineModules:min` task.
{/* How we integrate translations into the p5.js codebase. */}
2
+
3
+
# 🌐 Internationalization
4
+
5
+
[Internationalization](https://developer.mozilla.org/docs/Glossary/Internationalization_and_localization) (sometimes abbreviated "i18n") refers to supporting multiple languages in a software project. This often means maintaining translations of text strings used in the project and letting users choose which translation they receive (or detecting it from their browser settings).
6
+
7
+
p5.js uses internationalization in a bunch of areas (our contributor docs, [the official website](https://p5js.org), the reference, etc). We're expanding to include the console output of p5.js (which is primarily developer-facing error messages) in our internationalization efforts.
8
+
9
+
## Tooling
10
+
11
+
We've integrated [i18next](https://www.i18next.com) into the codebase. Currently we only use it in the un-minified build of p5.js. `p5.min.js` only includes the outer layer of our internationalization code and does not use it.
12
+
13
+
### Setup
14
+
15
+
We set up our i18next integration in `src/core/internationalization.js` and the translations are in `translations/`.
16
+
17
+
We set up the translation engine and autodetect the user's language from their browser settings before the p5 sketch is initialized. This ensures we can use translations for any errors we encounter in sketch `setup()` and `preload()`.
18
+
19
+
(If we encounter any errors in language autodetection, we fall back to English.)
20
+
21
+
#### No translations in `p5.min.js`
22
+
23
+
There is specific logic in the browserify build task and `src/core/init.js` to avoid loading or setting up translations in the minified build. Adding translations does not increase the size of the minified build.
24
+
25
+
### Using translations
26
+
27
+
To use translations include this line at the top of the file.
Translations like this expect the variables it uses to have a certain name, so make sure you use that. Check a translation file (look in `translations/{YOUR_LANGUAGE}/`) to see what the variable name is. You'll find the translation under the object path in the translation key.
64
+
65
+
"`fileLoading.notFound`" would be found at
66
+
67
+
```json
68
+
{
69
+
"fileLoading": {
70
+
"notFound": "I couldnt find {{fileName}}. Are you sure it's there?"
71
+
}
72
+
}
73
+
```
74
+
75
+
Variables are framed in"`{{` `}}`".
76
+
77
+
### Modifying translations
78
+
79
+
Simply open `translations/{YOUR_LANGUAGE}/translation.json`, find the translation with the key (like in the example just above) and edit away!
80
+
81
+
### Adding translations fornewlanguages
82
+
83
+
The easiest way to dothis is to add your language code (like "de"for German, "it"for Italian, etc) to the [locales list](https://github.com/processing/p5.js/blob/84bc1f92c89786f48e5d6fd1045feb649b932eea/package.json#L111-L114) in `package.json` and then from the terminal run '$ npm run build'.
84
+
85
+
This will generate you a fresh translations file in`translations/{LANGUAGE_CODE}/`! Now you can begin populating it with your fresh translations! 🥖
86
+
87
+
You'll also need to add an entry for it in [`translations/index.js`](../translations/index.js) and [`translations/dev.js`](../translations/dev.js). You can follow the pattern used in that file for `en` and `es`.
88
+
89
+
### Testing changes
90
+
91
+
The bulk of translations are not included in the final library, but are hosted online and are automatically downloaded by p5.js when it needs them. Updates to these only happen whenever a new version of p5.js is released.
92
+
93
+
However, if you want to see your changes (or any other changes which aren't released yet), you can simply run `npm run dev` which will build p5.js configured to use the translation files present locally on your computer, instead of the ones on the internet.
94
+
95
+
### Further Reading
96
+
97
+
See the [i18next translation function documentation](https://www.i18next.com/translation-function/essentials). Everything documented above is just a subset of their functionality.
p5.js uses [browserslist](https://browsersl.ist/) and [Babel](https://babeljs.io/) to provide support for older browsers. The browserslist configuration in use is [`last 2 versions, not dead`](https://browserslist.dev/?q=bGFzdCAyIHZlcnNpb25zLCBub3QgZGVhZA%3D%3D). `last 2 versions` means the last two releases of any browsers, `not dead` means browsers that had official support or updates in the past 24 months. Both of these conditions must be true for a browser to be supported.
8
+
9
+
In practice, you can still use most of the latest features available in Javascript because Babel will likely be able to transpile or polyfill them to something matching the required compatibility list. Some features such as [Web API](https://developer.mozilla.org/en-US/docs/Web/API), [WebGL](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API), or similar features not part of the core Javascript language cannot be handled by Babel and will need to be assessed on a case by case basis.
10
+
11
+
Good places to check if a feature is available are [caniuse.com](https://caniuse.com/) and [MDN](https://developer.mozilla.org/en-US/).
12
+
13
+
## Where does this apply
14
+
15
+
The supported browsers requirement will apply to the p5.js source code, all examples (both website examples page and documentation), and all official tutorials. Third party add-on libraries does not have to adhere to the same requirement but are encouraged to do so.
16
+
17
+
In many cases browsers not officially supported will likely still work with p5.js but we provide no guarantee for this case.
18
+
19
+
Stewards of each section will be responsible for ensuring PR involving code changes adhere to this requirement.
0 commit comments